JasperViewer equivalent can be used for web application

I have built jasper reports and able to show the reports on web page as PDF content. But I wanted to provide export functionality to xls,cvs etc what a JasperViewer(Swing) one provides.  Do we have simialiar class for webapplication where I can JasperPrint and get displayed on the page. 

Purpose of  this request to have JasperViewer equivalent is to achieve export functionality for my report(this is supported in JasperViewer). Im using below code in jsp now,

InputStream inputStream = this.getClass().getResourceAsStream(request.getAttribute("filename")+"");
JasperDesign jasperDesign = JRXmlLoader.load(inputStream);
JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);
JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport,(HashMap<String, Object>)request.getAttribute("params"), (JRBeanCollectionDataSource)request.getAttribute("beanColDataSource"));
But this opens JasperViewer swing UI.
madhan1kumar's picture
Joined: Apr 12 2017 - 10:10pm
Last seen: 5 years 7 months ago

@Hozawa   Could you share examples I can refer. Im not using Jasper report server now. Should I move to Jasper server?


madhan1kumar - 5 years 7 months ago

1 Answer:

JasperReports Server already has a button to export to csv, excel and other formats you've mentioned.


hozawa's picture
Joined: Apr 24 2010 - 4:31pm
Last seen: 3 years 5 months ago