Giri
Giri

Reputation: 85

JasperReports CSV export

I am using iReport 2.0.2. I want to suppress page headers and footers while exporting to CSV alone but not in any other format. Can anyone please let me know how to do that?

Upvotes: 2

Views: 5539

Answers (1)

Alex K
Alex K

Reputation: 22857

You should use the net.sf.jasperreports.export.{format}.exclude.origin.{suffix}.{arbitrary_name} report's property.

The snippet of jrxml file for excluding pageHeader and pageFooter bands from the resulting csv file:

<jasperReport ...>
    <property name="net.sf.jasperreports.export.csv.exclude.origin.band.1" value="pageHeader"/>
    <property name="net.sf.jasperreports.export.csv.exclude.origin.band.2" value="pageFooter"/>

These properties only affect the csv exporter in this sample. For example, the pdf document will be with two bands (page header and footer).

It works for iReport 4.x. I did not check it for 2.x version.


The additional info available in How can I suppress page headers and footers when exporting to XLS? topic of FAQ at http://community.jaspersoft.com.

Upvotes: 1

Related Questions