Image

The Image element is used to embed an image in the report. The Image element is a rectangular portion into which picture files can be loaded. Elixir 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, so they are the best choice. The bmp file format is supported in Sun's Java 7 (1.7) and later.

Select a Image element from the tool bar and place it in the report layout. Select the Properties from the pop up menu of the Image element.

Image Type

You can either embed a static or dynamic image in Elixir Report Designer. Static image is a prefixed image that is embedded at design time. For example, company.jpg. This can be achieved by selecting the URL Image type option.

A dynamic image allow a dynamic display of your images based on the data field name passed to in, it is like the Data field element except that it renders image instead of text. An example of dynamic images is a list of photo of the employee in the company. This can be achieved by using Field or Script Image type options.

Javascript graphics can also be used by defining in Javascript graphics tab.

The image types and their description are given below:

URL:

On selecting URL from the Image Type combo box the URL text box and the URL Type combo box appears.

The URL path is entered in the text box and the URL type is selected from the combo box. Either a local URL e.g. file:/C:/apple.gif or repository:/EnsembleWorkspace/berry.gif can be specified or a web URL link such as http://www.google.com/images/logo.gif can be entered.

Field:

Select the Field option from the Image Type combo box. The DataSource is selected from the list of data sources in the combo box. Alternatively, by clicking the Add button on the right of the combo box you can select a data source from the Configure DataSource Wizard. On clicking the Finish button in the Configure DataSource Wizard the selected data source will be added to the list of data sources in the DataSource combo box.

The data source field name and the corresponding data types are listed in a table in the Field tab. Select the required field from the list of DataSource fields. The field will retrieve the image from the database.

Script

Scripts can be used to specify a URL or path that points to the image. This is used for the dynamic display of images when the report is rendered.

Additionally, there is a Scripts tab contains the Render If, On Render Begin and the Render End text fields in which the JavaScript function to be rendered is entered.

In addition to some of the common properties the Image element has the Size mode property. The different size modes and their description are given below.

Clip: This is the default image mode. When this mode is selected the image is stretched to fit the specified width and height.

If the area(width and height) of the image is greater than that of the image element then the image is fitted in the middle of the specified boundary. Areas that exceed the boundary will be clipped off.

If the area of the image is lesser than that of the image element then the image will be fitted in the middle of the specified area.

Stretch: When you want to resize the image this mode is selected. The aspect ratio will not be taken into consideration while resizing the picture. Depending on the size specified the image will either be shrunk or expanded to fit into the specified area. It should be noted that this function works best with larger images.

If the area of the image is greater than that of the image element then the image is shrunk to fit the area specified, unlike clip where the image is clipped.

When the image area is lesser than that of the image element then the image is expanded to fit the area. If the image element's area is increased invariably then the image is stretched further to fit into the area and thus loosing it's original shape.

Zoom:

When you want to Zoom the image this mode has to be selected. The aspect ratio is taken into consideration while resizing the image.

If the image area is greater than that of the image element then the image is shrunk to fit into the boundary but it should be noted that not the whole area is filled as the image is shrunk while maintaining the aspect ratio.

When the image area is smaller than that of the image element the image is expanded to fit into the boundary but again the whole area is not filled.