views:

2093

answers:

2

We are using one template to render the report in CSV and PDF format. But the problem is we need to have report split into pages in PDF but not in CSV. Is it possible to alter the rendering options based on the format in one template. So that we have CSV without pagination information and PDF divided into page. In such a case 2 separate templates one for CSV and one for PDF should be used? or this can be achieved using one template?

+1  A: 

Finally found the answer. In the template following properties need to be set

<property name="net.sf.jasperreports.export.csv.exclude.origin.keep.first.band.columnHeader" value="columnHeader" />
            <property name="net.sf.jasperreports.export.csv.exclude.origin.band.columnFooter" value="columnFooter" />
            <property name="net.sf.jasperreports.export.csv.exclude.origin.band.pageFooter" value="pageFooter" />
            <property name="net.sf.jasperreports.export.csv.exclude.origin.band.lastPageFooter" value="lastPageFooter" />
            <property name="net.sf.jasperreports.export.csv.exclude.origin.band.summary" value="summary" />
This is useful but if you have a table element there does not seem to be similar properties to stop the repeat of the columns headings (presuming you want them repeated on the PDF across pages)
Mark