Embedding a Tableau Visualization into an IBM Cognos Report

Embedding a Tableau Visualization into an IBM Cognos Report

Question

Since all analytic content is accessed through Digital Hive, is there a way to leverage the Digital Hive platform to embed content from Tableau, PowerBI, or other BI systems, into an IBM Cognos report?

Answer

Digital Hive provides users with the ability to copy embed code and use it for different purposes. The feature to copy the embed code is enabled by default, but in order to make the embedding functional, some server settings need to be modified. 
  1. Log in to the Digital Hive server as an administrator, or as a user with privileges to modify installation files on the server
  2. Navigate to the <install_directory>\app\node1\tomcat\conf directory
  3. Open the web.xml file in a text editor
  4. Locate the following entries:
    <param-name>antiClickJackingOption</param-name>
    <param-value>SAMEORIGIN</param-value>
  5. Modify the entries to match the following values:
    <param-name>antiClickJackingEnabled</param-name>
    <param-value>false</param-value>
  6. Save the changes to the web.xml file
  7. From the same tomcat\conf directory, open the theia.properties file in a text editor
  8. Locate the following entry:
    motio.theia.contentSecurityPolicy=default-src 'self' 'unsafe-eval' 'unsafe-inline' https://*:*; img-src http: https: blob: data:
  9. Modify the entries to match the following values (using your domain as opposed to the digitalhive.com domain)
    motio.theia.contentSecurityPolicy=default-src 'self' 'unsafe-eval' 'unsafe-inline' https://*:*; frame-ancestors 'self' https://*.digitalhive.com:*; img-src http: https: blob: data
  10. Save the changes to the theia.properties file
  11. Restart the Digital Hive node-1 service
Once the service has started, the next step will be to get the required embed code from Digital Hive.
  1. Log into Digital Hive
  2. Locate the object to be embedded, either in a content lane, search results, or browsing the folder structure
  3. Mouse over the object and press the vertical ellipsis

  4. Select the Share option
  5. There are some header options that can be selected, then press Copy HTML Code

  6. Press DONE
  7. Paste the copied code into a text editor. Shown is what the embed code should look like


    NOTE: By default, embedding with this code will produce a small frame. You will need to add some HTML formatting to adjust the height and width as part of your web page code.

  8. If the above code is embedded into an HTML page, it will work as expected. IBM Cognos requires a specific syntax so the current embed code will have to be modified
  9. First, you'll need to locate the & characters and replace them with &amp;
  10. Then delete this portion at the end of the string (leaving the > character:

    loading="lazy" allow="focus-without-user-activation 'none';" allowTransparency /

  11. Add </iframe> at the end of the line AFTER the trailing >
  12. The final step will be to add some parameters to influence the size of the frame that will contain the Tableau report. In this scenario, we'll make the height and width 100%. Add the following to the beginning of the string between the opening <iframe src= part:
    style= "width:100%; height:100%;"
  13. The end result should look like this 

Now that the embed code has been modified for use with IBM Cognos, let's go ahead and the Tableau report to a Cognos report.
  1. Log into IBM Cognos. For this example, IBM Cognos Analytics 12.0.4 was used
  2. Create a blank report, and from the Insertable Objects list, drag an HTML Item to the report page 
  3. In the Properties panel, locate the HTML property
  4. Insert the modified embed code (as per step 13 above)

  5. Run the report and you will see the Tableau report, embedded into a Cognos report, through the use of the Digital Hive platform

Warning
Currently, you will need to have an active Digital Hive session for the rendering to work. This will be updated in the 2025.2 release so that the authentication to Digital Hive will occur automatically from an embedded request 
    • Related Articles

    • Display a Single IBM Cognos Analytics Dashboard Visualization

      Question Within an IBM Cognos Analytics dashboard, there is a single visualization that is needed to complete a Digital Hive data story. Following this knowledge base document, ...
    • Getting Prompted for IBM Cognos Analytics Credentials

      Question When viewing a Digital Hive page that contains an IBM Cognos Analytics visualization, the IBM Cognos Analytics login screen appears instead of the visualization. My IBM Cognos Analytics connector credentials are persisted as part of my ...
    • Running IBM Cognos Analytics Reports

      Question How do I run Cognos Reports? Answer The default setting for IBM Cognos Analytics reports is to display the saved report. Here are the steps to execute a report instead of showing the saved report: Click your avatar Select Manage Digital Hive ...
    • Tableau Views are not Resizing as Expected

      Question When embedding a Tableau view onto a Digital Hive page, the visualization isn't resizing as expected. In Tableau, the view is set to fit the 'Entire View' so it should resize nicely. But when the Tableau view is embedded within Digital Hive, ...
    • Connecting to IBM Cognos Analytics

      Question How do we connect Digital Hive to IBM Cognos Analytics? Answer As a Digital Hive administrator, connecting to IBM Cognos Analytics can be accomplished via the following steps: Open the Digital Hive Control Center Click on the Connectors and ...