If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Active Reports and external URLs with parameters

Started by Maximo-veikko, 14 May 2019 05:04:38 AM

Previous topic - Next topic

Maximo-veikko

If this has already been posted, apologies. I could not find this searching the forum.

tl;dr: Escape ampersands in HTML Items, even on Source Type = Text from the UI.

We had a need to create Active Reports with links to external application that passes parameters based on the line chosen in the Active Report. The building of a simple link with target as new windows is easy enough using HTML Items (multiple in the same column in this case), but passing the parameters causes the following error:

"HTML report output is not well formed. If your report uses "HTML Item" elements ensure that they result in well-formed HTML

reason: EntityRef: expecting ';'"

The properties of the HTML Items were:
1 - Source Type: text - HTML: <a href="http://server/path/?event=event&value=
2 - Source Type: Data Item Value - Data Item Value: COLUMN
3 - Source Type: text - HTML: " target="_blank">Link</a>

looking at the XML source this is translated to:
<HTMLItem>
   <dataSource>
      <staticValue>&lt;a href=&quot;http://server/path/?event=event&amp;value=</staticValue>
   </dataSource>
</HTMLItem>
<HTMLItem>
   <dataSource>
      <dataItemValue refDataItem="COLUMN"/>
   </dataSource>
</HTMLItem>
<HTMLItem>
   <dataSource>
      <staticValue>&quot; target=&quot;_blank&quot;&gt;Link&lt;/a&gt;</staticValue>
   </dataSource>
</HTMLItem>

The fix to this and the way to pass in the URL parameter is to escape the ampersand character and only the ampersand character:

The properties of the HTML Items after fix:
1 - Source Type: text - HTML: <a href="http://server/path/?event=event&amp;value=
2 - Source Type: Data Item Value - Data Item Value: COLUMN
3 - Source Type: text - HTML: " target="_blank">Link</a>

interestingly the XML source is now translated to nonsensical:
<HTMLItem>
   <dataSource>
      <staticValue>&lt;a href=&quot;http://server/path/?event=event&amp;amp;value=</staticValue>
   </dataSource>
</HTMLItem>
<HTMLItem>
   <dataSource>
      <dataItemValue refDataItem="COLUMN"/>
   </dataSource>
</HTMLItem>
<HTMLItem>
   <dataSource>
      <staticValue>&quot; target=&quot;_blank&quot;&gt;Link&lt;/a&gt;</staticValue>
   </dataSource>
</HTMLItem>

Yet the links from the Active Reports now works without issue.

Version: IBM Cognos Analytics 11.0.11