Jump to content
We've recently updated our Privacy Statement, available here ×

exporting entire data to a single page with CSV


padmav

Recommended Posts

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

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic


Please refer to http://jasperforge.org/website/jasperreportswebsite/trunk/config.reference.html?group_id=252

You 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-formats

Regards,

Serge

Link to comment
Share on other sites

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...