Adding a Simple Report Unit to the Server

Adding a Simple Report Unit to the Server

This section presents an example of uploading a JRXML to the server. The report only has two image resources. The example defines a custom query for the report unit.

To add the simple report unit to the server, you need access to the following sample data installed with the server:

<js-install>/samples/images/logo.jpg files

Uploading the Main JRXML

If you want to validate the JRXML before uploading it, use Jaspersoft Studio. The server doesn’t validate the JRXML when you upload it.

This procedure shows you how to set up a name for the report in the repository and upload the main JRXML file that references all other elements.

To upload the main JRXML for the simple report example:

1. Log into the server as administrator and select View > Repository.

If you log in as a user, you can upload a report unit to the server, but this example requires an administrator login to access the image resources.

2. Locate the folder where you want to add the report. For example, go to Organization > Reports.
3. Right-click the Reports folder and select Add Resource > JasperReport from the context menu. The Set Up the Report page of the JasperReport wizard appears.

Add Resource appears on the context menu only if you have write permission to the folder.

4. In Naming, enter the name and description of the new report and accept the generated Resource ID:
     Name – Display name of the report: New Simple Report
     Resource ID – Permanent designation of the report object in the repository: New_Simple_Report
     Description – Optional description displayed in the repository: This is a simple example
5. Select Upload a Local File and Browse to <js-install>samples/reports/AllAccounts.jrxml.

You can upload a new JRXML or select a JRXML from the repository.

In “Required Set Up Values” you can see the Set Up the Report page.

Required Set Up Values

6. Click Controls & Resources. The server uploads the main JRXML file. The Controls & Resources page reappears. If the server needs additional resources to validate the report, you'll be prompted to locate those resources.

Suggested Resources in the Resources List

A JRXML file doesn’t embed resources, such as images. When the server uploads the JRXML, it tries to detect any missing resources. For example, Suggested Resources in the Resources List shows that two image files are missing: