Click here to Skip to main content
15,867,889 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
i design a report in netbeans with datasource and all is fine but can anyone tell mee
how can i run this report from a class or a window form and wich library should i include in the project
thank you
Posted

1 solution

maven dependency for jasper
<dependency>
     <groupId>net.sf.jasperreports</groupId>
     <artifactId>jasperreports</artifactId>
     <version>5.1.2</version>
</dependency>


A way to generate report using compiled jasper
dataObject - List or Map of data values
jrxmlPath- Jasper path
JRBeanCollectionDataSource jrDataSource = new JRBeanCollectionDataSource(dataObject);

To run or generate report
JasperPrint jasperPrint = JasperFillManager.fillReport(jrxmlPath, jrDataSource);
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900