COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: dougp on 30 Oct 2018 04:32:25 PM

Title: Hyperlink produces error
Post by: dougp on 30 Oct 2018 04:32:25 PM
Cognos 11.0.7, interactive viewer

I want to add a hyperlink to a crosstab as a row member.  If I add several HTML items that concatenate to something simple, like...

<http://server/folder/subfolder/SearchViewer?SEARCH=My%20Document%20Search" target="_blank">Doc1234</a>

...it works fine.  As soon as I parameterize it...

<http://server/folder/subfolder/SearchViewer?SEARCH=My%20Document%20Search&Document%20Number=Doc1234&AutoRun=t&ViewSingleResult=True" target="_blank">Doc1234</a>

...running the report produces 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 ';'

URL:null
Line:266
Character:6508
Source:
This page contains the following errors:error on line 266 at column 6508: EntityRef: expecting ';'
Below is a rendering of the page up to the first error.


Of course, "Character: 6508" means that Cognos is not breaking up the code into something a human can reasonably troubleshoot.

It seems like Cognos is having trouble with the ampersand (&).  Is there a way I should escape it so this will work in Cognos?
Title: Re: Hyperlink produces error
Post by: Lynn on 31 Oct 2018 03:47:17 AM
Quote from: dougp on 30 Oct 2018 04:32:25 PM
Cognos 11.0.7, interactive viewer

I want to add a hyperlink to a crosstab as a row member.  If I add several HTML items that concatenate to something simple, like...

<http://server/folder/subfolder/SearchViewer?SEARCH=My%20Document%20Search" target="_blank">Doc1234</a>

...it works fine.  As soon as I parameterize it...

<http://server/folder/subfolder/SearchViewer?SEARCH=My%20Document%20Search&Document%20Number=Doc1234&AutoRun=t&ViewSingleResult=True" target="_blank">Doc1234</a>

...running the report produces 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 ';'

URL:null
Line:266
Character:6508
Source:
This page contains the following errors:error on line 266 at column 6508: EntityRef: expecting ';'
Below is a rendering of the page up to the first error.


Of course, "Character: 6508" means that Cognos is not breaking up the code into something a human can reasonably troubleshoot.

It seems like Cognos is having trouble with the ampersand (&).  Is there a way I should escape it so this will work in Cognos?

You could try encoding the ampersand as %26
https://www.w3schools.com/tags/ref_urlencode.asp

Perhaps others with stronger skills in this area might chime in.