SSRS URL Parameters with ‘&’

Was having an issue with opening a new window from an SSRS url action when the parameter name or value contained an ampersand, thanks to the following MSDN Forums thread

http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/6462b0f6-d784-4c7a-afe0-2813bec5770a/

and the javascript escape function problem solved

=”javascript:void(window.open(‘”+
http://richard-http://richard-pc/ReportServer/Pages/ReportViewer.aspx?/folder/report&rs:Command=Render&rs:Format=HTML4.0&rc:Toolbar=true&rc:Parameters=false&param1=”+
REPLACE(LTRIM(Parameters!param1.Value(0)),”&”, “‘ + escape(‘&’) + ‘”) +”&param2=”
+REPLACE(LTRIM(Parameters!param2.Value(0)),”&”, “‘ + escape(‘&’) + ‘”)  + “‘,’_blank’))”

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s