padmav Posted September 15, 2009 Share Posted September 15, 2009 Hi,I have created a report template that has header and footer. I use this for exporting to pdf and csv formats. When I export the report to csv format, it has multiple pages. So, csv file is showing header and footer for all the pages. So, I want to export all data in to a single page in csv export so that the header and footer are not displayed repeatedly. Is there any way to set the parameter to export entire data in to csv as single page. I am just wondering if there a parameter in JRExporterParameter that I can set. I see PAGE_INDEX, but that does not work in my case as I want the entire data as a single page in csv export. JRCsvExporter exporter = new JRCsvExporter(); exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, ouputStream);Thanks,Padma Link to comment Share on other sites More sharing options...
sergeleo Posted September 16, 2009 Share Posted September 16, 2009 Please refer to http://jasperforge.org/website/jasperreportswebsite/trunk/config.reference.html?group_id=252You can filter out content by setting up net.sf.jasperreports.export.{format}.exclude.origin.{suffix}.{arbitrary_name} property.More info here:http://stackoverflow.com/questions/665412/jasper-report-using-same-template-to-render-in-csv-and-pdf-formatsRegards, Serge Link to comment Share on other sites More sharing options...
padmav Posted September 16, 2009 Author Share Posted September 16, 2009 Serge, Thank you for your reply. I am new to jasper reports. How do I set these properties. Where do I cut and paste the properites in jrxml template file?When I tried to cut and paste the following properties in the report template, I am getting error. <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" /> Could you please explain further about the location where to set these properties.Thanks,Padma Link to comment Share on other sites More sharing options...
padmav Posted September 17, 2009 Author Share Posted September 17, 2009 Serge,I found the issue. Earlier, I put these properties in the wrong location. After putting the properties, in the right location, below the first line in Jasper reports template, it started working now. Thank you very much for helping with this.Padma Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now