开发者

Generating Jasper reports report with CSV datasource from memory

开发者 https://www.devze.com 2023-01-16 06:45 出处:网络
I want to do the following: Make a servlet which wo开发者_StackOverflowuld sit in a servlet container. I would feed the jasper report definition xml to it, the parameters, plus the data for the repor

I want to do the following:

Make a servlet which wo开发者_StackOverflowuld 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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消