In this blog we are going to cover the points related to the usage of image component. The image component can be used to add logos, icons, images etc related to the data being displayed etc.
Note: As of now the image file types which are supported are JPEG, JPG and PNG only.
An image field can be dragged from left field and text can be added.
When an image component is selected, on the right side, various kind of configuration options of image appears which are explained below.
The various kind of image configuration options are described below
- Appearance: This property defines how the image will appear on the report.
- File Name: In this section, user can define the path from which the image needs to be taken. The image needs to be uploaded from the backend using FTP or can also be uploaded from the frontend browser.
- XY coordinates and Height Width: You can define the X and Y coordinates and the height and width of the image. Please note that the height and width of the image should be equal for proper rendering.
- Alignment: If the scale type for the image is Clip or RetainShape and the actual image is smaller than its defined size in the report template or does not have the same proportions, the image might not occupy all the space allocated to it in the report template. In these conditions the image can be both horizontally and vertically aligned within its report element. Two attributes are responsible for the image alignment:
- Vertical – specifies the vertical alignment. Possible values are: Top, Middle, Bottom.
- Horizontal – specifies the horizontal alignment. Possible values are: Left, Center, Right.
In order to upload from the frontend browser click on “Select”
The file browser will open. You can see the folders that contain canned reports.
Right click on the folder that you want to save the image in and select Import. Select the image that you want to upload. The image is now uploaded.
With the above process the file gets uploaded (imported) into the filder. You can see the path of the folder in which the image is stored by right clicking on the folder and going to Properties. You can copy the physical location from here.
In the file path, pasted the physical location copied from the file browser and add the image name to it.
The image is now available on the canvas.
- Evaluation Time – Specify the moment when the image expression gets evaluated. The image expression can be processed at the end of present band or page, group, report, column, specific band etc.
- Eval Group – Select the group based on which the evaluation time will be processed. This is used when the Evaluation Time is set to Group
- Style Name – Used when styles have been defined using Page Properties.
- Fill – Fill type of the image background – Solid is the default.
- Scale Image – indicates how should be rendered the image when its actual size does not fit the size of the image report element. This is because in a lot of situations images are loaded at runtime and there is no way to know their exact size when creating the report template. Possible values for this attribute are:
- Clip – if the actual image is larger than the image element size, it will be cut off so that it keeps its original resolution, and only the region that fits the specified size will be displayed.
- FillFrame – if the dimensions of the actual image do not fit those specified for the image element that displays it, the image is forced to obey them and stretch itself so that it fits in the designated output area. It will be deformed if necessary.
- RetainShape – if the actual image does not fit into the image element, it can be adapted to those dimensions while keeping its original undeformed proportions.
- RealHeight – the image can be stretched vertically to match the actual image height, while preserving the declared width of the image element.
- RealSize – the image can be stretched vertically to match the actual image height, while adjusting the width of the image element to match the actual image width.
- On Error Type: Defines what should be displayed if there is error in rendering the image
- Rotation: Defines the rotation of the image on loading.
- Position: Position of the image origin
- Stretch: In case of image overflow, how the container or element should be stretched.
- Print Repeated Values: Prints values that are repeated
- Remove Line when Blank: If the image is blank, then no line should be printed.
- Is Lazy – flag that specifies whether the image should be loaded and processed during report filling or during exporting, in case that the image is not available at fill time. By default this flag is set to false. When it is set to true, an image path String is stored at fill time instead of the image itself, and during the exporting process the image will be loaded from the location read from this path String.
- Is Using Cache – flag that indicates if an image should be loaded each time it gets displayed in a report, or if it should be loaded only once and then stored in a memory cache for better performance. For images with static content applying the caching mechanism is strongly recommended. When one set the isUsingCache attribute to true, the reporting engine will try to recognize previously loaded images using their specified source
- Print in First whole band – Used when print repeated values is false. The image is printed in a whole band on the page
- Print when detail overflows – If the detail overflows the container, then whether it should be printed on the next page.