![]() |
|
![]() |
||
![]() |
||||
|
Exporting reports 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. ![]() Figure 1 ![]() 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 ![]() 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 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. ![]() Figure 6 If the final report does not contain any pages, iReport displays the following message instead of the document: ![]() 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. |
||||
![]() |
|
![]() |