Working with Images

The process of adding an image to a layout consist of two main steps. The first step involves the Report Designer layout tool, in which you must add a reference to the image by adding an image object to the layout and specifying the required image settings. The second step involves including runtime support for the image. This page describes different scenarios related to working with images.

How to add an IFS company logo

The steps below describe the process of adding a IFS logo (IFSlogbw.gif) to your report. This includes adding an image reference to the layout in design time.

  1. Set the default graphics path in the Report Designer tool  - Go to IFS Report Designer Options dialog (Edit menu Options) and specify the Graphics path as shown below:

       

This is generally a file location in your client machine and needs to be done only once since it is a tool setting.

  1. Add the image to the schema tree - Go to the Graphics folder listed under the schema tree and select Add graphics from the RMB menu options.

  1. Browse to the image you want to use.

Press Ok to continue. The selected image file will now be listed under the schema tree as depicted below. Once the image is added a folder structure containing this image will be created under the graphics path specified in step (1).  This structure comprises of the following elements.  report_designer_graphics\<module_name>\<package_name>\IFSlogbw.gif. 

 

  1. Now place the image on the layout by simply dragging and dropping the image from the schema tree to the layout. It's important to remember in this step that it is only a reference to the image that is added to the layout and the actual image does not get embedded to the layout. The reference to the image is usually a file path or a http/ftp path which will be used in runtime to fetch the image from it's stored location.
  2. When you drag and drop the image on the layout, the image property "Keep aspect ratio" will be selected.

                     

If the property is checked the image will shrink until it completely fits inside the container box/table cell width. The aspect ratio (proportions) of the image will stay as the original. The alignment inside the box will be upper left corner. If the checkbox is unchecked, the image will align to the upper left corner, but the image will be resized according to the parent (Table Cell/Container) dimensions. Following image shows the sample preview of different instances, when the property enabled and disabled.

6.   To get the default logotype behavior simply select the Dynamic image stored on disk option and check the default logotype support check box. The default behavior will work as follows

  1. If an archive variable with the name rhSysLogo exists for this particular archive item that logotype will be used.
  2. If no rhSysLogo archive variable exists the logotype specified in the default logotype XML element will be used. This logotype is either the complogo.gif if such file exist or the ifslogbw.gif if no complogo.gif exist.
  3. Any logotype path specified in rhSysLogo archive variable will be overridden by changing the file extension from .bmp to .gif. This is necessary since IFS Report Designer doesn't work with bitmap images. Any bitmap logotype used needs to be converted to gif, jpeg, or png images to be able to be used with Report Designer.

7.    Save and preview the layout from the tool and verify if the image is correctly shown in design time.

How to add a non-IFS company logo

  1. Set the default graphics path in the Report Designer tool if it's not done already.
  2. In order to view this company logo from the tool's preview you must have the corresponding image file in your client machine in the same location where the default logo ifslogbw.gif is located. Name this image file as complogo.gif.
  3. Add a reference to the image file in your layout by following steps from (2) to (4) above.
  4. Select Dynamic image stored on disk option and make sure the Default logo support check box has been selected.
  5. Execute the report and verify that the company logo can be previewed correctly in design time.

If complogo.gif file does not exist the IFS logo will be shown as the default company logo.

For runtime support have a look at the section Setup Images at runtime.

How to add non logo type images

Sometimes you may need to add a static image that does not necessarily serve as a company logo rather  servers a different purpose in the report functionality. If your requirement is such then follow the instructions below to get the images working for your report.

  1. Perform the steps from (1) to (4) listed in the first scenario and add an image object to the layout. This will create the following folder structure inside the tool's default graphics path. See step (1).

report_designer_graphics\<module_name>\<reprot_id>\image_name.gif. 

  1.  Select the option Dynamic image stored on disk from the dialog and clear the following items:
  1. Checkbox for default logotype support (Uncheck)
  2. Value set for Explicit runtime image path
  3. Value set for Fallback runtime image path.

Set the File extension conversion value to that of your image file (gif, png or jpeg) 

For runtime support the same folder structure should be checked in to the version control system. Have a look at the section Setup Images at runtime for more details.

Another method of using images in Report Designer is to refer to an image stored in Application server using an absolute path. This is how you must add the design time support.

  1. Add an image object to the layout. 
  2. Select the option Dynamic image stored on disk. In the Explicit runtime image path specify the absolute path containing the image file located in the application server. For example if the image that you need to add is located in the application server  D:\temp folder, specify the absolute path as D:\temp. Press Ok to continue.
  3. In the application server, make sure the image you made reference to in the layout is present in the path specified in Explicit runtime image path.
  4. Execute the report and verify if the image can be seen in runtime.

One can also use a http/ftp path when referring to images. The http/ftp path in this case must point to the image file of your choice.

  1. Add an image object to the layout. 
  2. In the Explicit runtime image path specify the http/ftp path containing the image file of your choice.
  1. Save the layout execute the report and verify if the image can be seen in runtime.

Here unlike in the previous scenarios you need not copy image files to the application server.

Working with images stored in database

In this approach the images to be referenced in the report must be stored in the database. When a request is made to print or preview the report the image/images are directly fetched from the database table. The relevant image is returned using a SQL statement that is specified in the layout.  This query is set using the Report Designer Tool as shown below.

Follow the steps below to add design time support and runtime references.

  1. Add an image object to the layout.   
  2. Select the option Dynamic image stored in Database.
  3. In the text field SQL statement returning an image, specify a valid SQL query which will return the desired image from the database table.(SELECT data FROM binary_data_block WHERE blob_id=:1 AND seq=:2) The values given for the WHERE clause can be passed on as Binding variables. For instance in the above example, the value for blob_id is mapped to the first bind variable (tns:PICTURE_ID) which is denoted by "=:1" and the value for seq will be mapped to the second bind variable(1) which is denoted by "=:2". Up to five bind variables can be specified in the field Bind variable values each separated by semicolons. The value given for a Bind variable can be a Xpath such as tns:PICTURE_ID returning a valid id or even a hardcoded value such as the second bind variable in the  example above. When the report is executed in runtime the above sql query information you provide is used to retrieve the correct image from the database table.

However when the report is previewed from the Report Designer Tool, the images are fetched from the client machine where the tool is running and not from the database. Similar to how it works in the all of the previous scenarios listed above.

To complete the runtime setup make sure the images have been saved on to the database. Use BLOB or LONG RAW formats for storing.

Working with dynamic images

Dynamic images are those in which the image changes depending on some variable in the XML or based on some condition. Dynamic images can be added to a report using both approaches described above. That is the images can either reside on a disk or be stored in a database.  For example when you use a XPath to fetch images stored from a database as shown above is a typical example of using dynamic images. 

Following scenarios describe how to work with dynamic images when the images are stored on disk. First a reference to the image must be given in the layout. This is done by adding some image object to the layout and specifying the means in which the image path is fetched in runtime. The next step is where the image files are copied to the application server.

Fetch the runtime image path using a XPath value

The file paths to the dynamic image can be fetched using a value returned from a XPath. This is very similar to how we fetch all other data items from the XML. The difference being that in the XML a file path is stored for the corresponding XPath and not the actual data (the image in our case) embedded to the XML.

Follow the steps below to add dynamic images using a XPath reference.

  1. Add an image object to the layout.   
  2. Set the XPath (which will return a file path to the image) in the Explicit runtime image path.

In the above example the XPath tns:INVENTORY_PART_IMAGE should return a valid file path. For example C:\temp\part1.gif.  It is also possible to pass a http/ftp path for the XPath value.

  1. In the application server, make sure the image files are physically present in the folder path returned by the XPath value. If not, copy the image files to the corresponding location in the application server. In the case of a http/ftp path being returned by the XPath value you need not copy any image files to the application server.
  2. Execute the report and verify if the image can be seen in runtime.

Use of rhSysLogo

The rhSysLogo variable specified in the RDF can also be used specify different image paths depending on different report conditions. For instance one can set different image paths to the rhSysLogo variable depending on different company id's. This way you can display the different company logo's on the same report when the company id changes.

  1. Add an image object to the layout.  
  2. Make sure the Default logo support checkbox has been selected.
  3. Execute the report and verify if the image can be seen in runtime.

Setup Images at runtime

As of UPD7 images used in layouts are by default fetched from the database at runtime. These include the standard logos (IFSlogbw.gif and complogo.gif) and images that you inserted in to the layout. The IFS installer will import the logos and images to the database from the folder locations repository\server\reports\stdlogo and repository\server\reports\images from the IFS home. So it's good that you adhere to all the version controlling and have all the logos and images used in layouts in your version control repository and build home and thereby having the correct files to be import from the IFS home repository.

As of UPD8 you can use the Solution Manager \ Operational Reporting \ Report Images page in Aurena to manage your logos and images. You can add, delete or modify the images from this page.

If the logos or the images are not found in the database, then the fallback location for logos and images is taken from the value specified in the system parameter "Fallback image path for Report Designer when image is not in the database". The logos and images should be available to this location. Here the image file used as the company logo, in this case the IFSlogbw.gif or the complogo.gif should be present in the following folder structure: <fallback_graphics_path>\ stdlogo\IFSlogbw.gif or complogo.gif. For images other than logos the folder structure should be copied to the <fallback_graphics_path>\report_designer_graphics\. For example <fallback_graphics_path>\report_designer_graphics\<module_name>\<report_id>\. However this is only a fallback mechanism. If all logos and images are correctly available in the repository then this is not used and images are taken from the database.

Fallback Image Path