Jasper report using the same template for rendering in CSV and PDF formats

We use one template to render the report in CSV and PDF format. But the problem is that we need to split the report into pages in PDF format, but not in CSV. Is it possible to change the rendering options based on the format in one template. So we have a CSV without pagination information and paginated pdf. In this case, you should use 2 separate templates for CSV and one for PDF? or can this be achieved using a single template?

+3
source share
2 answers

Finally found the answer. The following properties must be set in the template

<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" />
+4
source
+4

Source: https://habr.com/ru/post/1705080/


All Articles