Chandu Chandu - 1 year ago 87
Java Question

How to integrate JasperViewer with Swing based application

can I integrate the JasperReports Viewer to my Swing application as like if I click on view report button from my application then viewer should be opened. If so could you advise me with code snippet for this integration and in this viewer the save as type should be restricted for PDF only rather than every other download option filter available.

Please advice me in this regard.

Answer Source

Yes you can, Jasper Reports come with a usable (albeit simple) report viewer:

           JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);
           JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport...);

The last line is what displays the viewer. I'm not sure if you can restrict the available output formats to PDF, though.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download