Adding a Dynamic Image in a BI Publisher/Oracle Analytics Publisher Report

To add a dynamic Unifier image in a BI Publisher/Oracle Analytics Publisher report, you must create a data set in the Data Model (XDM) file, as explained below.

Note: The following instructions apply to reports that run directly on the BI Publisher/Oracle Analytics Publisher server. The BI Publisher/Oracle Analytics Publisher reports that run via Unifier do not require these changes.

In the .XDM file:

<dataSet name="security_token" type="complex">

<sql>

<![CDATA[SELECT token_value sec_token from ( SELECT token_value,expired,ROW_NUMBER() OVER (ORDER BY expired desc) rn FROM sys_server_token WHERE token_type = 'img') where rn = 1]]>

</sql>

</dataSet>

<group name="security_token" label="security_token" source="security_token">

<element name="SEC_TOKEN" value="SEC_TOKEN" label="SEC_TOKEN" dataType="xsd:string" breakOrder="" fieldOrder="1"/>

</group>

Note: The purpose is to get the server token from database where "expired" is the maximum from all the rows.

In the report template that requires to have the image to be inserted, change the "Alt text" of the image to point to image retrieval URL.

To retrieve a Unifier image, use the URL: https://unifier-server-address /bluedoor/rest/image/<image_id>/<server_token>

The report parameter uuu_p_urlF can be created in Data Model (XDM) file with a default value, so at the runtime the server address-part of the URL can be changed appropriately:

<parameter name="uuu_p_urlF" defaultValue="https://unifier-server-address/bluedoor/rest/image" dataType="xsd:string" rowPlacement="8">

<input label="uuu_p_urlF" size="100"/>

</parameter>

The report template uses this URL in the "Alt text" of the image, as in: url:{concat($uuu_p_urlF,'/',DATA_IMAGE_ID,'/',//security_token/SEC_TOKEN[1])}

Where: uuu_p_urlF can be the template variable, for example: <?variable@begin:uuu_p_urlF;(.//uuu_p_urlF)[1]?>

The security token, retrieved from DB by the dataset is: //security_token/SEC_TOKEN[1]

The runtime data (image ID) is: DATA_IMAGE_ID

Additional Information

In a Cloud deployment, you can use the "uuu_p_tenantIdF" data element for passing the tenant ID to the BI Publisher/Oracle Analytics Publisher report. This will include the required URL needed for accessing the image file in the BI Publisher/Oracle Analytics Publisher report. For legacy BI Publisher/Oracle Analytics Publisher reports, in a Cloud or On-premises deployment, you can continue to use the following data elements for passing the user ID to the BI Publisher/Oracle Analytics Publisher report:



Last Published Tuesday, December 12, 2023