user1133591
user1133591

Reputation: 21

Exporting a report with multiple sheets from JasperServer to Excel

I created a report using iReport and set the 'One Page per Sheet' option to true in the Excel Export parameters, this generates a report in iReport with multiple sheets.

I then loaded the report onto JasperServer, the report's output appears on multiple pages, exporting the report to Excel results in the data appearing on one sheet instead of multiple sheets.

Is there a way or an option that can be set so that the data appears on multiple sheets when exported from JasperServer?

Thank you.

Upvotes: 2

Views: 8709

Answers (2)

JDGuide
JDGuide

Reputation: 6525

You just remove IS_ONE_PAGE_PER_SHEET.Its working 100% .

exporterXLS.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.FALSE); 

Just remove this line of coding from your code.

Upvotes: 0

Alex K
Alex K

Reputation: 22857

You can use the net.sf.jasperreports.export.xls.one.page.per.sheet property.

The information about this property is here.

  • The property can be added to the jasperreports.properties file (in *jasperserver\WEB-INF\classes* folder):
net.sf.jasperreports.export.xls.one.page.per.sheet=true
  • The property can be added to the report template (jrxml file)

The sample:

<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" ...>
    <property name="ireport.zoom" value="1.0"/>
    <property name="ireport.x" value="0"/>
    <property name="ireport.y" value="0"/>
    <property name="net.sf.jasperreports.export.xls.one.page.per.sheet" value="true"/>

Upvotes: 3

Related Questions