Aditya Ekbote
Aditya Ekbote

Reputation: 1553

How to pass Query to Ireport table control through jsp

I am working on iReport 5.5 and MySQL 5.0. I have created a jrxml file which has one table control. I have passed below query to it.

    select invoice_no,start_date,gross_amount from tbl_invoice where client="ABC Cars"

Now, i want to pass parameter to it through JSP page. Please solve my query.

Upvotes: 0

Views: 442

Answers (1)

Endrik
Endrik

Reputation: 2258

If you are planning to generate a report from your JSP application, you can follow this tutorial (it talks about JSF, but basically it's the same) : JSF + JPA + JasperReports. In the above case, on this line jasperPrint=JasperFillManager.fillReport(reportPath, new HashMap(),beanCollectionDataSource); it specifies a new empty HashMap. It is used to pass parameters to the report. On this link you can see that you can pass several elements to such a map, and use it to pass them as parameters to the report: Passing parameters to JasperReports

Upvotes: 1

Related Questions