Sunday, August 10, 2014

Exporting PRPT reports to Multi-worksheets excels



It is very common for business users to get access to a pentaho PRPT report in Excel spreadsheet format.  They may choose to print it and bundle it with other printed materials and distribute it as a packet.  They may want to share it with coworkers who do not have access to the online version of the report.   They also may want to look at the raw data in excel format and perform their own data analysis.

By default, PRPT reports can be downloaded as excel spreadsheets.  However, in real world spreadsheets commonly have multiple worksheets populated with data from multiple data sources and contain charts or plots in different formats.  Challenge is how to design a PRPT report so that it generates such a spreadsheet when downloaded.

The first thing to do is to design the report and determining what data needs to be displayed on each worksheet.  Since each worksheet can contain data from different data sources, you need to use subreports.  Therefore, each subreport can be the container for each worksheet.  Keep in mind that the subreports need to be banded subreports.  To create a subreport, drap and drop a subreport from the left side of PRD.  When the Insert Subreport query pops up, select "Banded". 

Adding subreports


Insert Subreport query
YOU MUST specify Banded






This will open up the subreport tab in PRD.  you can design the internals of a subreport just like any other report. 

The final step is to specify a page break and the sheetname.  From the master report, select the style tab.  specify a name for the sheetname in the excel section,  and select True for the pagebreak-before. 



Simply preview your report in excel format and you can see the different worksheets.