I have created one SSRS report having begin date and end date. If I provide end date< start date it will execute the report as shown in the image
But that condition I need to show a pop up "Please Check the start date and end date provided". How to do this?
Click Report Menu then Report Properties.
Go to Code Tab and add similar code as per your requirement:
And
Follow the Steps:
1.) Go the Report Parameters and add a parameter with the datatype is string.
2.) Check the Hidden checkbox and Allow blank value ckeckbox.
3.) From Default Values choose Non-Queried radio button and then press the FX button and paste this code.
=CODE.CheckDateParameters(.Value,.Value)
Then press OK.
See reference Link:
Easy Step by Step SSRS Parameter Validation Using Code & Conditional DataSet
I'm answering this to chip in another possible solution when working with SQL/Server. If you just want to throw an error then simply amend your query SQL to raise an error on the SQL/Server side by adding something like this to the top of your SQL...
The query won't run and the error message will be displayed in the report body.