How to export a birt report to xlsx? [message #930534] |
Tue, 02 October 2012 08:02  |
Eclipse User |
|
|
|
Hi,
I'm generating a big report, it has 600.000 lines and I need export this report to Excel.
When I export, it's generated a XLS contains some tabs with 65535 lines. Is it possible to generate one tab with all lines in XLSX?
I'm used Birt 3.7.1.
Regards,
Marcelo
|
|
|
|
|
|
Re: How to export a birt report to xlsx? [message #1036272 is a reply to message #930534] |
Mon, 08 April 2013 02:56  |
Eclipse User |
|
|
|
The beforeFactory script did not work for me (Birt 4.2.2, nativexls emitter 1.0.0).
However, the viewer does have an option:
__excelRenderOption.officeVersion=office2007
this is not documented anywhere I could find, found out looking at the sources.
With the option the emitter generates xlsx formatted files, but still uses the xls extension for the file name. In order to change the extension name add the following entry to web.xml:
<context-param>
<param-name>BIRT_FILENAME_GENERATOR_CLASS</param-name>
<param-value>packagepath.XslRenamerFilenameGenerator</param-value>
</context-param>
And put this class in your sources:
import java.util.Map;
import org.eclipse.birt.report.utility.filename.DefaultFilenameGenerator;
import org.eclipse.birt.report.utility.filename.IFilenameGenerator;
public class XslRenamerFilenameGenerator extends DefaultFilenameGenerator implements IFilenameGenerator {
public String getFilename(String baseName, String extension, String outputType, Map options) {
return super.getFilename(baseName, "xls".equals(extension) ? "xlsx" : extension, outputType, options);
}
}
This is explained in more detail here:
birtworld.blogspot.com.au/2008/09/naming-exported-files-from-birt.html
|
|
|
Powered by
FUDForum. Page generated in 0.08804 seconds