Jump to content
Changes to the Jaspersoft community edition download ×

How to print the data which is in Collection

Recommended Posts

By: stone_cold - bssai

How to print the data which is in Collection

2006-05-02 14:55



I am using Hibernate database and have retrived the data and is nw located in a collection of object. I have created the .jrxml usng the iReport template by name "ship.jrxml" . I would like to how to get the report in desired format as the per the input options done using a Radio button in a jsp page. Here is the JR Code that i have written as for now. Please let me know wat shud be done next.



JasperDesign design = JasperManager.loadXmlDesign("C:\ship.jrxml");

JasperReport report = JasperManager.compileReport(design);

JRDataSource dataSource = new JRHibernateListDataSource().getClass().getFields();

Map parameters = new java.util.HashMap();


JasperPrint print = JasperManager.fillReport(

report, parameters, dataSource);



JasperExportManager.exportReportToHtmlFile(print, "hello.html");




JasperExportManager.exportReportToPdfFile(print, "hello.pdf");




JasperExportManager.exportReportToXmlFile(print, "hello.xml", false);



Thanks and Regards,


Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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...