-
How do I create jasper report using EJB? (5 messages)
- Posted by: Loganathan Natarajan
- Posted on: January 09 2008 11:31 EST
Is there any details about EJB-JASPER reports integration? i am looking for EJB integration or support from JASPER i have done samples with jSP/as well as plan java classesThreaded Messages (5)
- Re: How do I create jasper report using EJB? by Ashish Agrawal on January 10 2008 03:16 EST
- Re: How do I create jasper report using EJB? by mahendra samineni on January 23 2008 17:29 EST
- Use Session Facade by Tarun Arora on January 11 2008 01:37 EST
- Re: How do I create jasper report using EJB? by David Thielen on January 14 2008 08:57 EST
- User-friendly Java reporting tool by David Freezea on August 24 2009 11:21 EDT
-
Re: How do I create jasper report using EJB?[ Go to top ]
- Posted by: Ashish Agrawal
- Posted on: January 10 2008 03:16 EST
- in response to Loganathan Natarajan
What do you mean by EJB integration? I could generate the report just by writing this simple code private static void generateReport() { JasperReport jasperReport; JasperPrint jasperPrint; try { jasperReport = JasperCompileManager .compileReport("reports/ShipmentsReport_new.jrxml"); Connection c = getConnection(); jasperPrint = JasperFillManager.fillReport(jasperReport, new HashMap(), c); JasperExportManager.exportReportToPdfFile(jasperPrint, "reports/simple_report.pdf"); JRXlsExporter xlsExporter = new JRXlsExporter(); xlsExporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); xlsExporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, "reports" + "/" + "classic" + ".xls"); System.out.println("Exporting report..."); xlsExporter.exportReport(); System.out.println("Done!"); close(c); } catch (JRException e) { e.printStackTrace(); } } I think you can as well write the same code in an EJB and generate report.If you want to work with entity beans then I guess there is no support as of now. -
Re: How do I create jasper report using EJB?[ Go to top ]
- Posted by: mahendra samineni
- Posted on: January 23 2008 17:29 EST
- in response to Ashish Agrawal
Ejb or Jasper doesn't have any special feature for this. But there are diffrent kind of solution for work with ejb. All those are support to work with object list.For this you have to implements JRDataSource best of luck mahee -
Use Session Facade[ Go to top ]
- Posted by: Tarun Arora
- Posted on: January 11 2008 01:37 EST
- in response to Loganathan Natarajan
I guess..wat u want is that.. Build a Session Bean which would contain the logic of report generation using Jasper Reports. Now this Session Bean can interact with an Entity Bean to get the data which can be passed to Jasper Report as a datasource. Now the crux here is that it won't be a gud idea to pass an entity bean directly to the Jasper API rather u can create some value objects in between and send them as datasource to Jasper Reports. Thanks, Tarun -
Re: How do I create jasper report using EJB?[ Go to top ]
- Posted by: David Thielen
- Posted on: January 14 2008 08:57 EST
- in response to Loganathan Natarajan
I don't know if this is any help but if you download the Windward Reports Java engine, it has a complete EJB example using it's reporting engine in sample 5. Jasper is (a lot) more complicated but the basic approach is the same. thanks - dave -
User-friendly Java reporting tool[ Go to top ]
- Posted by: David Freezea
- Posted on: August 24 2009 11:21 EDT
- in response to Loganathan Natarajan
Hi, Loganathan Natarjan. In fact, you can try RAQ Report. It is an user-friendly Java reporting tool.