Praveen
Praveen

Reputation: 11

Displaying Popup alert for SSRS Parameter validations

I am working on a SSRS report which has From & To date as input parameters and it has to be validated such that From date can't be more than To date.

I was successful in creating a custom VB code which takes care of validation but the problem is when the validation fails i need to display a user friendly pop up alert which i am not able to do. I tried giving the alert using MsgBox (VB.NET) and also tried calling Response.Write inside javascript, but none of these works. Help me in getting this done.

Upvotes: 1

Views: 9733

Answers (1)

Shailesh B. Rathi
Shailesh B. Rathi

Reputation: 111

Following are the steps that you can follow to achieve this.

  1. In the code section of the report add the following code. Public Function SelectedMore( ParamCnt As Integer ) As Boolean Dim Cnt As Boolean Cnt = IIf(ParamCnt < 4 , 1, 0) Return Cnt End Function
  2. Add a text box on the report layout page and add contents to it saying user has selected more than 3 parameter values. You can make this bold and red if you want.
  3. Then go to the properties of the above text box and go to ‘visibility’ tab. Select ‘Show or hide based on the expression’ and add the following expression in the box ‘=Code.SelectedMore(Parameters!HeatMapList.Count)’. This will make this textbox visible only when more than 3 values are selected.
  4. Now go to the parameters of the main dataset ( the onw which fetches the results for you), go to the parameters tab and next to parameter HeatList, click the expression button (fx). In the expression box type in the following code, =IIf(Parameters!HeatMapList.Count > 3, Nothing, Parameters!HeatMapList.Value). This will not pass any value to your main dataset for the parameter and results would return empty. You can alternately add the visibility expression inverse to that of the above textbox, for the main tablix. This will hide the table when textbox is displayed and vise-versa.

Upvotes: 0

Related Questions