Vasil
Vasil

Reputation: 38106

Generating Jasper reports report with CSV datasource from memory

I want to do the following:

Make a servlet which would sit in a servlet container. I would feed the jasper report definition xml to it, the parameters, plus the data for the report in CSV as POST data in HTTP request. The servlet would respond with the generated report file. I need this because I want to generate reports from my own python web application. And I don't want to expose my database to jasper server + I'm probably going to do more processing to the data from my own application.

Is this possible? If so, where should I begin? What classes from jasper reports should I consider using?

Upvotes: 1

Views: 3192

Answers (1)

Giorgos Dimtsas
Giorgos Dimtsas

Reputation: 12609

This should help you get started

http://www.ensode.net/jasperreports_pdf_send_to_browser.html

In your case, you will have to create a JRCsvDataSource with your data and pass it to the JasperRunManager#runReportToPdf method instead of the JREmptyDataSource, along with any parameters and your report file.

Upvotes: 3

Related Questions