Image
The Image element is used to embed an image in the report.
This element is a rectangular portion into which picture files can be loaded. The Report Designer support image formats such as jpg, png, bmp and gif. The exact file formats supported varies with Java version and vendor implementation.
The jpg and png file formats are supported across all implementations, they are the best choice. bmp file format is supported in Sun’s Java 7 (1.7) and later.
Add Image
To add an image onto the report, select the “Image” button and click onto the location where you wish to place the image. A “Image Wizard” will appear.
There are three tabs in this wizard:
- Image
- Scripts
- JavaScript Graphics
Image Tab
In the “Image” tab, the “Image Type” field allows you to select the type of image to place into the report. There are three options:
- Field
- Script
- URL
Field
If the “Field” option is selected in the “Image Type” field, the following screen will appear.
Select the desired datasource in the “Data Source” field and select the desired field in the table below it.
Script
If the “Script” option is selected in the “Image Type” field, the following screen will appear.
Key in the Java into the textbox below to specify a URL or path that points to the image. This is useful to display images dynamically when the report is rendered.
URL
If the “URL” option (default) is selected in the “Image Type” field, the following screen will appear.
Key in URL path of the desired image file in the textbox next to the “URL” field. Alternatively, select the desired URL of the image file from the repository by clicking on the button.
Scripts Tab
This tab has three panels which allows you to add Java scripts:
- Render If
- On Render Begin
- On Render End
The JavaScript functions that are entered in these text boxes are executed when the image is rendered.
JavaScript Graphics Tab
This tab allows you to add JavaScript for the image.
Edit Image
To edit the image in the report template, double-click on the Image element to display the “Properties” dialog box.
The three tabs in this dialog box is similar to the Image Wizard.