views:

45

answers:

1

Hi all,

can I integrate the jasper report 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.

Regards, Chandu

+1  A: 

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

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

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

Tomislav Nakic-Alfirevic