Adding a Disclaimer to an SSRS Report the easy way

I had a requirement to add a disclaimer message to a report that the user needs to agree to before they can see the report.

My initial idea was to simply add it as a parameter, but the message was quite long and it looked terrible, so this is the solution I came up with.

Simply Put

I have 2 controls, one with the disclaimer, the other a data table. When the user clicks Agree in the disclaimer the action reloads the same report but passes in a parameter. I use that parameter to show/hide the 2 controls.

Like I said, the easy way.

Creating it on a report

Step 1 – Organise the components

To make it easy, if there are many things you need to hide, put them all in a rectangle, that way you can just show/hide the rectangle.

Step 2 – Add the Parameter

Add a hidden Boolean Parameter to the report called DisclaimerAccepted with a default value of false.

Step 3 – Add the Disclaimer

Add the disclaimer inside a rectangle called recDisclaimer.

A Disclaimer in SSRS

Add the expression [@DisclaimerAccepted] to the visible property of the rectangle. This will hide the rectangle when DisclaimerAccepted = true.

Setting the Visibility setting in an SSRS report

Step 4 – Add the Agree and Disagree items

On the Agree textbox add the following Action

SSRS Action to open a report with parameters

Similar to the Agree, add a textbox for Disagree with an Action similar to Agree, but the DisclaimerAccepted should equal false. This will pretty much do nothing.

Step 5 – Set the Visibility on the report detail

Whether you put everything in a rectangle in step one or you only have a table, set the Visibility on that object to…

=Not Parameters!DisclaimerAccepted.Value

What it looks like

This is what my report looks like in design

An SSRS report with a disclaimer

This is what it looks like when it is been run

The user has entered search criteria and pressed View Report

A disclaimer showing in SSRS
  • The user does have to run the report for the disclaimer to show because the parameter is required. If the parameter was not required, or there was no parameter, the disclaimer would show.

After Clicking Agree

After Agreeing to the SSRS discalimer
  • Notice that the parameter that was entered has been carried across, that is, no need to be entered twice.

Leave a Reply

Your email address will not be published. Required fields are marked *