
Images
An image is a digital representation of a picture. JReport supports the following image formats: .bmp, .gif, .jpg, and .png.
This section describes how to use the image component.
Inserting an image into a report
An image can be inserted in the report areas listed in Component placement.
To insert an image into a report:
- Position the mouse pointer at the destination where you want to insert the image.
- Do one of the following to display the Select an Image dialog.
- Click Insert > Image on the menu bar.
- Click the Insert Image button
on the Insert toolbar.
- Drag Image from the Toolbox panel to the destination.
- Specify the image you want to insert.
- If you want to use an image from your local file system, use the Look in drop-down list to browse for the image, then click Open. If the image file is not in the current catalog directory, you will be prompted to copy it to the directory.
- If you want to use an image via URL, enter the URL in the URL field and then click OK.
- Click Open to insert the image into the destination.
Notes:
- If want to use an image via URL and you are in an intranet, to successfully access the image, you need to add the parameters
-DproxyHost=XXX -DproxyPort=XX
to JReport Designer's startup file JReport.bat, which is located in <install_root>\bin
.
- If you insert an image via URL into a report, when the report is saved, only the URL information will be saved into the report template.
When an image has been inserted into a report, you can customize its appearance and behavior by setting properties in the Report Inspector, which can be saved as a CSS style for future use (for details, see Creating a CSS style).
Binding a link to an image
You can make an image link with other reports, locations specified by URLs or e-mail addresses. To do this:
- Right-click the image and click Link on the shortcut menu.
- In the Insert Link dialog, select the target to which the image will be linked by checking the corresponding link type: Link to Report, Master/Detail Report, Link to URL or Link to E-mail.
- Set the options for the link target as required.
- When done, click OK.
For details about different link targets, see Binding a link to a label.
See an example: The SampleComponents catalog, included with JReport Designer, contains reports that have examples of how each component type could be used in a report. For the image component example, open <install_root>\Demo\Reports\SampleComponents\ForImage.cls
.
