Jump to content
Changes to the Jaspersoft community edition download ×
  • Exporting reports with Jaspersoft Studio


    morlandin
    • Edited on:
    • Features: Exporters Version: v8 Product: Jaspersoft® Studio

    Overview

    In addition to generating and viewing reports, Jaspersoft Studio allows you to export reports into many formats, including  PDF, XLS, HTML and others. In this tutorial we will go over the steps necessary to export a generated report using Jaspersoft Studio. We'll use the report generated during the tutorial Designing a Report with Jaspersoft Studio.

    Compiling the Report

    When you switch on the Preview tab in the designer bottom bar, Jaspersoft Studio performs a set of operations to create the final report. The first operation compiles the JRXML source file in a Jasper file. This first step can fail if the elements are not correctly positioned (for example, if an element is placed outside of a band), or if an expression in the report has errors and cannot be compiled.

    If the compilation runs successfully, the produced Jasper file is loaded and filled using the active connection or data source. This second operation can also lead to errors. This can happen if the referenced database is not active, an invalid query has been provided, or a null field produced an error in an expression during the filling process. If all operations complete without error, the report is displayed in the integrated viewer. Errors are shown in the Report State window, after clicking the Errors button, as shown in the following image:

    1(10).png.a0aad956f5568d13c15207f254002103.png

    If errors occur during the compilation, the tab changes from Preview to Design.

    Preview and Exporting

    If the compilation completes and there are no errors in the file, the preview is shown. From there you can browse the generated report and change its visualization, change the data source or export the report. Note that after changing the data source the report is recompiled automatically.  You can also change the preview format and save the report in different formats.

    2(7).png.898ff0d0b21f34c67463c3b3db6a733f.png

    In the image you can see that there is a green Play button. Clicking this button forces the report to be regenerated; it should be used when a subreport changes, or when you want to execute the report with different input parameters. When you set a preview format, the report is automatically regenerated in the chosen format, and the corresponding viewer application is opened - a PDF viewer or OpenOffice, for example.

     

    See Also:


    User Feedback

    Recommended Comments

    There are no comments to display.



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...