views:

251

answers:

1

Hey, i want to Use Dynamic japser to create reports of my database i.e MYSQL. Plus, i want to know that can i send attirbutes to dynamic jasper which a user is going to select from the front end based on XHTML MP and then i want dyanamic jasper to make report on the selected attributs. P.s I m sending selected attributes through servlet to Dynamic Jasper

Thanks Sundhas

A: 

You are already answering it

The receiving servlet, lets call it ReportingTestServlet, this servlet will receive the attributes from the front end.

Create a utility class lets call it ReportGenerator, I prefer to use utility classes to make things more maintainable if you want to add more reports to the servlet later. This class will look something like this Fixed Column Width Test, this is a sample from DJ. Mainly the class will take the parameters and return a DynamicReport object.

Finally you will write something like DjReportTest that takes the DynamicReport and using JasperReport API create a JasperPrint object, this object could be easily exported to PDF/HTML/RTF from the JasperReport API

Hope that helps

medopal