Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » How to export a birt report to xlsx?
How to export a birt report to xlsx? [message #930534] Tue, 02 October 2012 08:02 Go to next message
marcelo gomes is currently offline marcelo gomes
Messages: 2
Registered: October 2012
Junior Member
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 #930808 is a reply to message #930534] Tue, 02 October 2012 13:00 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Marcelo

The default xls emitter does not support this. You will need to look at possibly using a different emitter.
Take a look at the last post in this thread:
http://www.eclipse.org/forums/index.php/m/813294/
If you decide to replace the default xls emitter have a look at:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=350662

Jason
Re: How to export a birt report to xlsx? [message #930884 is a reply to message #930808] Tue, 02 October 2012 14:29 Go to previous messageGo to next message
marcelo gomes is currently offline marcelo gomes
Messages: 2
Registered: October 2012
Junior Member
Thanks Jason,

How can I change the OFFICE VERSION? I'm using Birt 3.7.1 and generating XLS by servlet /frameset?__report=xyz.rptdesign&__sessionId=20121002_152444_075&__format=xls&__asattachment=true&__overwrite=false

options.setOption( IExcelRenderOption.OFFICE_VERSION, "office2007");

Regards,
Marcelo
Re: How to export a birt report to xlsx? [message #931114 is a reply to message #930884] Tue, 02 October 2012 19:50 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

I do not think that option is currently in the viewer. Can you try adding the following code to the beforeFactory script of the report?

importPackage(Packages.org.eclipse.birt.report.engine.api);
reportContext.getRenderOption().setOption(EXCELRenderOption.OFFICE_VERSION, "office2007");

Jason
Re: How to export a birt report to xlsx? [message #1036272 is a reply to message #930534] Mon, 08 April 2013 02:56 Go to previous message
Left Blank is currently offline Left Blank
Messages: 1
Registered: April 2013
Junior Member
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
Previous Topic:Web Viewer Issue
Next Topic:Where do I set library.path in BIRT
Goto Forum:
  


Current Time: Tue Jul 29 09:01:34 EDT 2014

Powered by FUDForum. Page generated in 0.02114 seconds