Monday, 7 December 2015

I recently wanted to set op a series of interlinked reports using SQL Server Reporting Services (SSRS) targetting a 2012 instance. I used javascript in a "Custom URL" action on a field to create the link. Everything looked OK, but further testing I noticed the following type of error was often being generated in in the drill through report:

The report execution xnf441454bs2oh45hqvrkd45 has expired or cannot be found. (rsExecutionNotFound)

The problem was the parameter: I was using a text field to pass through information for the parameter, and this textual information could include an Ampersand (&).

This is obviously a reserved character, so requires escaping.

To do this, we must utilise SSRS's commands REPLACE and ESCAPE in the custom action. The easiest way to explain this is in this example: