If needed files are missing, as shown in “Suggested Resources in the Resources List”. you need to take one of the following actions:
| • | Upload resources that the report needs |
| • | Select a resource from the repository |
If the Controls & Resources page doesn’t suggest resources, perhaps the report doesn’t reference any. However, the server can’t always detect all the referenced resources, as discussed in Uploading Undetected File Resources.
To upload suggested file resources for the simple report example:
| 1. | Click Add Now in the row of the missing resource. For example, LogoLink. The Locate File Resource page appears. |
| 2. | Choose Select a resource from the Repository and Browse to the needed file (Images/JR Logo). |
| Any image file works. |
The path to the image appears in the wizard.
| 4. | Click Next. The Add a Report Resource page appears. |
|
Properties of a Resource |
| The properties include the LogoLink name, resource ID, and description. These properties don’t redefine the properties of the JRLogo file in the repository. |
| 5. | Click Next to accept the default naming of the file resource. |
The Controls & Resources page appears again, showing that the LogoLink resource was added.
| 6. | Click Add Now in the AllAccounts_Res2 row. The Locate File Resource page appears again. |
| 7. | Select Upload a Local File and Browse to <js-install>/samples/images/logo.jpg. |
| 8. | Open logo.jpg, and click Next. The server uploads the file. |
The Add a Report Resource page appears, showing the properties of the file resource.
| The properties include the AllAccounts_Res2 name, resource ID, and description. |
| 9. | Click Next to accept the default naming of the file resource. |
The Controls & Resources page reappears, showing the addition of both resources referenced in the main JRXML.
| 10. | Click Data Source and define a data source as described in the next section. |
Referencing Styles
You can apply a style to your report by referencing a property sheet, created in Jaspersoft Studio, that contains information on a style.
To do this, you will need to edit the Styles.jrxml file and change the <templates> statement.
To reference styles from an external property sheet:
| 1. | Locate and open the Styles.jrxml file. |
| 2. | In the JRXML file, declare <template>"repo:styles"</template> (do not include the .jrtx extension). |
| 4. | Log into the sever as an administrator, and select View > Repository. |
| 5. | Expand the Organization folder. |
| 6. | Right-click the Reports folder and select Add Resource > JasperReport to open the Add JasperReport wizard. |
| 7. | On the Set Up page, enter the required information. |
| 8. | Select Upload a Local File and click Browse... |
| 9. | Locate Styles.jrxml, and click Open. |
| 11. | Copy the base_styles.jrtx file from the directory: |
<jrs-install>samplestemplatesreports
and place into the C: directory.
| 12. | Edit the styles.jrtx file and add C: before base_styles.jrtx. |
| 13. | Back on the server, select View > Repository, then expand the Organization folder. |
| 14. | Right-click Images, and select Add Resource > File > Style Template. |
| 15. | Under Path to File, click Browse... then locate the style.jrtx file. |
| 16. | Enter a Name (Styles) and click Submit. |
| 17. | In the repository, open the Reports > Styles folder, then right click on Styles report and select Edit. |
| 18. | Click Control & Resources, then click the Add Resource... link. |
| 19. | Select Select a resource from the Repository radio button, Browse... |
| 20. | Locate Organization > Images > Styles, and click Select. |
| 22. | On the Add a Report Resource screen, enter Name: Styles, then click Next. |
Recommended Comments
There are no comments to display.