Jaspersoft BI Tools

iReport,Jaspersoft Design Studio,Jaspersoft Server, Schema Workbench,Analysis,Dashboards, Self Service BI, Domains,Topics,Ad-Hoc Reports, Jaspersoft ETL, Embedding BI,HTML-5 charts, Fusion Charts,JFree Charts,Drill down reports , Drill down Dashboards,Visualize.js, Performance Tuning, D3 Charts, Jaspersoft Customization

Thursday, October 10, 2013

Export report output to multiple sheets of excel- Page breaking in jasper iReport or Studio

Hello Community,

NOTE : Find the update section : Updated On  14th April 2015 : Example JRXML

You can break the page where ever you want and export to excel in jasper server. 
For this you need to give  the properties  shown in image to jasper iReport  report.

Right  click on report Name from Reporot Insepctor > Properties -> report properties

net.sf.jasperreports.export.xls.one.page.per.sheet true
net.sf.jasperreports.export.xls.sheet.names.1 Pivot Remit
net.sf.jasperreports.export.xls.sheet.names.3 Detail
net.sf.jasperreports.export.xls.sheet.names.2 Summary
net.sf.jasperreports.page.break.no.pagination apply


As shown in the above picture use the page breaks where ever you want to break the report to a page when exporting to excel.

Update 14th April 2015 : Example JRXML
Click Me to Download JRXML Example

Click Me to Download the Sample Excel Output File of the Above JRXML

Quick Screenshot :

NOTE : The above example JRXML runs on PostgreSQL foodmart database.

Server file changes : 

add below line of property in jasperreports.properties file

Location of the file :

Quick Steps :
1) Keep the elements in User Defined Groups (bands)
2) Take Data sets to be used by elements kept on User Defined groups (bands)
3) Place the break element either at the end of elements.
4) Set Ignore Pagination= true for the report (If you use sub reports do the same).
5) Add net.sf.jasperreports.export.xls.one.page.per.sheet=true property in jasperreports.properties file.
6) set below shown properties for the report.

7) Save the report publish it the server and export the output to Excel.
Sample output image :