I want to export to CSV with the Header and Footer only showing once
The current output:
Name Address Hobby
AAA US XXXXX
BBB UK XXXXX
(Footer)
Name Address Hobby
CCC ID XXXXX
DDD CC XXXXX
(Footer)
Name Address Hobby
EEE SA XXXXX
FFF ZM XXXXX
(Footer)
The desired output:
Name Address Hobby
AAA US XXXXX
BBB UK XXXXX
CCC ID XXXXX
DDD CC XXXXX
EEE SA XXXXX
FFF ZM XXXXX
(Footer)
So how do I get the Header and footer to only show once ?
EDIT:
Footer looks like
Version : 1.0.0
AcademicProgramBusinessEntityCentreDoma Execution Time : 00:00:00.00
/NWU/StudentInformation/AcademicProgramDevelopment Build: v1.0.9 - Dev
You can use net.sf.jasperreports.export.{format}.exclude.origin.{suffix}.{arbitrary_name}(see the http://jasperreports.sourceforge.net/config.reference.html page for details) property for excluding bands (Page Header and Page Footer in your case) for exporter.
The sample:
The input data, csv file (datasource):
The jrxml file:
The report's design in iReport:
The result of JRPdfExporter will be:
Both bands are present in PDF file
The result of JRCsvExporter will be (the output csv file):
Both bands are absent in CSV file.
As you can see I've excluded two bands (Page Header and Page Footer) only for JRCsvExporter.
For more details you can also see this post: JasperReports: hide textfield when not HTML view
to prevent column header repeating you can use following property:
for example to avoid column header repeating in csv you write:
https://community.jaspersoft.com/wiki/how-can-i-suppress-page-headers-and-footers-when-exporting-xls