Sunday, 15 December 2013

Preventing SSRS Autorun

Technology: SQL Server 2008 R2 Reporting Services

When developing a parameterised SSRS report using BIDS I had the requirement of specifying a default value for every filter. The report would be executed directly from SharePoint or called from an ASP web application which passed specific values through to the filters. In either case, the report was automatically running as soon as the user navigated to it - normal functionality if all parameters have values.
The problem was that the end users needed the ability to verify their parameters and change if necessary, before execution.
I searched for quite some time, looking for a property of the report where I could prevent auto-run, but nothing turned up. That left me with 2 solutions:

1 - Do not default one of the parameters so auto-run won't kick in i.e. force the user to have to choose one of their parameters. I didn't like this method as its extra work for the user and their original requirement was to have all parameters defaulted, so it would be a contradiction.

2 - Add a new parameter with no default value (to prevent auto-run) which allows blank values, meaning the user can simply ignore it. This was the better solution for my scenario, so I created a new parameter with the following configuration:



I called this 'System Use Only' so the users would know to ignore it. This parameter appears on the report as an empty text box, therefore forcing the users to hit Apply to see results:



Alternatively, you could make use of this text box to capture an electronic signature to display on the report for auditing, a time stamp, or some other user input which could show on the report and be printed with it.

1 comment:

  1. Seems to be very user-friendly, especially when using electronic signature for sharepoint as in our case...

    ReplyDelete