Posts Tagged ‘Jasper Reports’

Using JasperReports in your Flex Application

Sunday, February 15th, 2009

Last week, I came cross the Flash Viewer for JasperReports. JasperReports is an OpenSource Java Framework to build Reports based on different data sources. We’re using in our projects JasperReports to generate PDF reports, too.

The Flash Viewer Project is using the Flex SDK to render the JasperReports for the HTML or Web based application. All source files of the viewer are available, so that you can customize the viewer for your needs.

But you can’t replace a interactive Flex chart component with the report viewer, because the viewer only generates a static output of the report. You can also using the JFree Chart extensions of the JasperReports, but neither the Charts nor the Text Information are selectable. If you’re changing any data of the report, you have to fill the report again in your Java Backend and rerender the report with the viewer.

So, using the viewer make only sense if you using it as preview of the report or if your reports aren’t as complex and interactive. And the best thing about the viewer is that you can use the same source file for your web and print output.

Additional Infos:

To use the Flash Viewer, you have to setup a Java web server like (Tomcat…) and run the webapp of the Flash Viewer. You get the webapp, if you download the project zip of the Flash Viewer. To display a report, you have to compile the report definition (jrpxml file) and fill the the compiled report. After that, you can use the Flash Viewer to display the report. The project zip contains a sample report, which demostrates how to use the flash viewer.