XLSX metadata exporter


In my project there is a need to export reports to excel. While standard XLSExporter is really nice, we would like to have plain tables without headers/footers. From what I can tell there is a JRXlsMetadataExporter which would fit perfectly for that.

However, based on my tests, it exports to the old Excel format XLS, not the XLSX. The main problem is that it has a row number limit of  65536 which is quite low,  while XLSX has a limit of 2^20 (just over 1 million)

Sadly I wasn't able to find an equivalent exporter for XLSX. Does this exporter support exporting to XLSX as well? Do I have to set some flag for it to happen?

Btw. I'm not sure if it would actually be needed but is there an option to export to multiple files if report doesn't fit into a single XLS/XLSX file?

amongalen's picture
Joined: May 22 2018 - 1:06am
Last seen: 3 years 1 week ago

2 Answers:

If you don't want header and footer when exporting, just set properties to exclude them. Following page may help you.


hozawa's picture
Joined: Apr 24 2010 - 4:31pm
Last seen: 3 years 11 months ago

It is a nice option. However, I don't think it provides all the functionality I need. I'd like to remove report/group header/footers while at the same time display some of the data from them for each record.

E.g: I have some goods in different warehouses. I want to group it by warehouse ID. While exporting to PDF I want to have warehouse name/ID/address displayed in the group header and for each warehouse display all goods stored in it. Then when I export to XLSX I'd like to have all this information displayed in each row. This way it would  be much easier for the user to analize the data, create some charts etc.

I can achieve this reasult using CSV metadata exporter (I guess it works the same for XLS one) by simply setting the net.sf.jasperreports.export.csv.column.name and net.sf.jasperreports.export.csv.repeat.value for fields I want to keep.

However, some of the users have a lot of data so XLS with its limit isn't enough. Generating CSV and then manually importing it in XLSX isn't an acceptable solution either.

A workaround I can think of is to create another report with much simpler layout containing elements I want to export to XLSX only and then switch in runtime which one to generate.

amongalen's picture
Joined: May 22 2018 - 1:06am
Last seen: 3 years 1 week ago