Managing Resources in the Repository from iReport

While creating reports that you intend to store in the repository, you also need to create and manage the resources associated with them, such as images, JARs, JRXML files, property files for localized reports, input controls, datatypes, lists of values, style templates (JRTX), and data sources. If you’re maintaining existing reports, you may need to access, modify, and save changes to existing resources. You can also modify the location, name, or description of the repository folders.

To add, modify, or delete resources to the repository from iReport:

1. If the Repository Navigator is not open, click Window > JasperReports Server Repository.
2. To add a resource to the repository, right-click a folder, select Add, and then select the type of object you want to add.

If you choose to add any item other than a JasperReport, a dialog for entering the location and other information about the object appears. If you choose to add a JasperReport, a wizard guides you through the process.

3. To change the location of a resource in the repository, locate the object, then drag-and-drop it to the new location.

Or, perform the following steps:

a. Right-click the object and select Copy or Cut. Or use the keyboard shortcuts: Ctrl-C and Ctrl-X, respectively.
b. Locate the destination, right-click, and select Paste, or use the keyboard shortcut Ctrl-V.

When cutting the object, it is not removed from its original location until pasted in the new location.

4. To delete a resource from the repository, locate the object, right-click it, and select Delete. You must confirm your action to prevent accidental deletions.
5. To modify a resource, find its folder in the Repository Navigator, then right-click the resource and select Properties.

In the Properties dialog appears. The number of tabs in the dialog depends on the type of resource:

6. On the General tab, view the object’s repository ID, name, and description.

If you are logged in as an administrator, you can modify property values and save them back to the Repository.

Tabs other than General, if there are any, contain controls that are specific to each type of resource. File-based resources have a Resource tab.

7. On the Resource tab, check Replace the resource with this file, browse to another image on your hard drive, and click Save to replace the image on the server with the image on your hard drive.
8. Click Export File, and then Save to download a resource descriptor to your hard drive.

For example, in the Repository Navigator, you can replace a resource on one server with a resource on another: Connect to both servers using the plug-in, export an image from server 1, open image properties on server 2, browse to the file you exported from server 1.

9. Change an input control from the Input Control Details tab:

Properties of an Input Control Resource

10. Click Save in the Properties dialog box to make the changes effective in the repository.