Skip to Content
Technical Articles
Author's profile photo Geetha Madhuri Bobbili

Part 1: How to Create Dynamic Images in SAP Analytics Cloud Story

Author: Geetha Madhuri Bobbili
LinkedIn Profile:



In SAP Analytics Cloud, we can add static images or dynamic images (stored in a remote database Ex: SAP HANA) to a Story.



To create a dynamic image, you will need a model based on a HANA view with the following attributes:

  • A column containing BLOB data, used in the dynamic image. It is recommended that the image BLOBs used are less than 5MB in size.
  • A column containing a unique ID used to link the image model to an aggregate model via linked models.
  • When queries are performed on the aggregate model, the image object will update if a single member is filtered down to in the aggregate query.

This prerequisite is necessary to prevent duplicate image data to be added to the model.


  • Dynamic image objects are not supported in the mobile application and cannot be embedded in header widgets.
  • Dynamic image objects don’t support measure-based filters on the source model.


  1. First step is to create a HANA Table to Store the Images and Image Content of type ST_MEMORY_LOB.
  2. Download the images to display in SAC as a dynamic image and save the images in a folder.(Example: C:\\SampleImages)
  3. Upload the image in to HANA Table (created in the previous steps) using Java Class File.
  4. Create a Calculation View of type dimension.
  5. Create join between the Calculation View and table contains at least one measure.
  6. Create Model using the Calculation View in SAC.
  7. Create Stories with Image Dimension in SAC.

Upload Images in to SAP HANA


In SAP HANA we can store an image using BLOB (Binary Large Object) object up to 2 GB. BLOB can store a large volume of data, including PDF files, audio and video files.

To consume images in SAP Analytics Cloud the format should be ST_MEMORY_LOB in HANA.

Create a HANA Table:


1. Create a Column Store table with the below SQL statement.

2. Right click on the table, select Open Definition.

3. Save the Sample Images in a folder. For this demo, I have downloaded the below images and saved in “C:\\SampleImages”.


Create a Java Class File:


4. Create a JAVA project in HANA studio using the JAVA EE Perspective to load the images into HANA Table. Add ‘ngbc.jar’ on your libraries in the Java build path. For this right click on your project –>Build Path –>Configure Build Path–>Libraries–>Add External JARs–>Add the File Location.

5. Create a Class file and write the Java Code with the necessary details like Host Name, Instance Number, User Name, Password and Schema.

6. Run the Code by Right clicking on the Class File–>Run As–>Java Application.

7. You can see the similar message in Console.

8. Now the images are uploaded in to the table. You can check this by right clicking on the table –>Open Data Preview.


Create Calculation View:


9. Create a Calculation View of Type Dimension.

10. Drag and drop Projection Node and add the table to the Projection Node.

11. Select the INDUSTRY_ID as Key in Semantics and activate the view.

12. Create a Calculation View of type Cube with Star Join.

13. Drag and drop the Calculation View of type dimension created in previous steps in Star Join.

14. Drag and drop Projection and add a table which is having INDUSTRY_ID and at least one measure.

15. Join the table with Calculation View of type dimension. (Do not join with the transaction data table).

16. Activate the Calculation View.



Now we have created Image Dimension in HANA. In Part 2 of the blog series, we will create a Live HANA Model on the Calculation View in SAP Analytics Cloud and consume the images in a Story.


Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Roxana Dehelean
      Roxana Dehelean

      Hello Geetha, great article !

      I am trying to follow your instrctions in order to implement  dynamic images in a SAC story but i'm having a difficult time creating the Java class file. Do you think you could share the entire java code you used to create the class ?

      Thanks !



      Author's profile photo Marcos Carvalho
      Marcos Carvalho

      Hi Roxana,


      The code is available in the following link:




      Author's profile photo Andreas J A Schneider
      Andreas J A Schneider

      Great blog.

      But many customers have images stored on a file server or possibly even a web server and do not want to replicate those images into an SAP HANA database. Instead they want to be able to embed those images into an SAC Table widget, sourced from the filer server (on premise),  e.g. displaying a list of all products with their corresponding images a retailer is offering incl. Product ID, Price, Revenue, Profit, offered discounts, etc.

      Author's profile photo Sara D'Onorio
      Sara D'Onorio
      Hello Andreas,
      This is exactly what a customer asked me, a SAC Table with a list of products and their corresponding images.
      Do you know if it is possible to achieve this on SAC?
      Author's profile photo Andreas J A Schneider
      Andreas J A Schneider

      Sorry, I have no update on this. Maybe, anyone else?