1

I'm using SSRS Action -> Go To Url like this:

="javascript:void(window.open('http://xxx/xxx/Pages/ReportViewer.aspx?%2fDevelopment%2fReport&rs:Command=Render&Parameter="& Parameters!Parameter.Value &"'))"

generated link should be:

http://xxx/xx/Pages/ReportViewer.aspx?/Development/Report&rs:Command=Render&Parameter=Úxxx

I need to somehow escape special characters with diacritics like character 'Ú' in example above. Without escaping this character the above link is broken.

Thanks for you help.

Rutz
  • 119
  • 4
  • 15

3 Answers3

5

You need to URL encode your parameter, however referencing System.Web (as many suggest) is problematic, since later versions of the Reporting Services designer seem to run in a partial trust context, and System.Web does not have APTCA.

Instead, in later framework versions you have the choice of using System.Uri.EscapeDataString or System.Net.WebUtility

See SO question How do you UrlEncode without using System.Web? for examples of both, neither of which require full trust

Community
  • 1
  • 1
piers7
  • 4,174
  • 34
  • 47
2

You need to add Url encoding to your outgoing parameters. This article explains how to reference the library in the report and user UrlEncode() to process your parameters.

Ross Bush
  • 14,648
  • 2
  • 32
  • 55
0

For anyone else who is trying to work out what to type in SSRS to get your URLs containing HTML character codes not to be changed and converted to ASCII characters you can right-click on the area outside the report and go to Report Properties...

Report Properties

Then click on Code on the left and enter this:

Function OpenURL(ByVal URL As String) As String
    Return "javascript:void(window.open('" & System.Uri.EscapeDataString(URL) & "','_blank'))"
End Function

Then in the field you want to be clickable, right-click on it, go to Text Box Properties... and on the action section on the left select Go to URL, click on the Expression button and enter (where URL is the name of your field in the dataset containing the link you want to open:

=Code.OpenURL(Fields!URL.Value)

The URL should then remain as originally specified and not convert any characters.

Robin Wilson
  • 308
  • 2
  • 11