Jump to content
We've recently updated our Privacy Statement, available here ×
  • Exporting Reports with iReport Designer


    Giulio Toffoli
    • Product: iReport Designer

    by Giulio Toffoli

    When you click the preview button in the designer tool bar, iReport performs a set of operations to create the final report. The first operation is to compile 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 again lead to errors, for example 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. Finally, if all operations complete without error, the report is displayed in the integrated viewer.

    Errors are shown in the Report Problems Window, and operation results are shown in the iReport output, both of which share the bottom of the iReport screen.

    figure_2.png.53a3fa3c74770247817dceb02c0c74e9.png
    Figure 1
    figure_1.png.fe779f52c283a995935fbede50e148c1.png
    Figure 2

    Reports can be exported in several formats by clicking Save in the preview tool bar or by setting a proper preview format in the Preview menu:

    figure_3.png.9a318d559ce22c3c9221eaa1af03b474.png
    Figure 3
    figure_4.png.a197c8dcac6d733c9f3a25de58f4cb5c.png
    Figure 4

    To export again a report that has not been modified, click Run again in the preview tool bar. Running a report again is useful when a subreport changes, when the datasource changes, or when you want to execute the report with different input parameters.

    figure_5.png.97e554aa6af1cd25f3c117d6da83bf95.png
    Figure 5

    When you set a preview format, the report is automatically exported to the chosen format when you click Preview, and the corresponding viewer application is opened, for example a PDF viewer or OpenOffice.

    On Windows and MacOS, iReport is able to identify the proper viewer for each format automatically based on the system defaults. However it is possible to manually set the viewer application for each format by selecting Tools > Options > iReport > Viewers:

    figure_6.png.8fcb0879e99f0ed597cccd4ced0dbcc0.png
    Figure 6

    If the final report does not contain any pages, iReport displays the following message instead of the document:

    figure_7.png.435c1d40853fa023bddd0ca33677e9af.png
    Figure 7

    This is not an error, iReport is just saying that the report is empty. This can happen under several circumstances, usually when the SQL query or the data source used to fill the report has not provided any data. If you see this message, check your database connection and test the query in your report.

    If you're embedding your reports in another application, now you need to deploy your reports.

     


    User Feedback

    Recommended Comments

    There are no comments to display.



    Guest
    This is now closed for further comments

×
×
  • Create New...