Report Parameter validation in ssrs report

后端 未结 3 577
一个人的身影
一个人的身影 2020-12-21 10:37

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

3条回答
  •  醉话见心
    2020-12-21 11:16

    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...

    IF @ParEndDate < @ParStartDate
    BEGIN
       RAISERROR('Please check the start date and end date provided', 16, 1);
       RETURN;
    END;
    

    The query won't run and the error message will be displayed in the report body.

提交回复
热议问题