How to restrict the StartDate not greater than EndDate
If we have two parameters StartDate and EndDate in report . and we enter StartDate > EndDate How to restrict in sqlserver reporting services report that must show message . dont enter startdate greater than end date.
September 19th, 2012 2:16am

A way I can think of how to solve this would be this: Add an extra (internal) parameter called "DateValidation"Set the default value of this parameter to: =Iif(Parameters!StartDate.Value > Parameters!EndDate.Value, 0, 1)Create two rectangles in your report, one of them is where you have all the report contents, one rectangle only shows the error messageSet the visibility option for the first rectangle (with the report items) to =Iif(Parameters!DateValidation.Value = 1, False, True)Set the visibility option for the second rectangle (with the error message) to =Iif(Parameters!DateValidation.Value = 0, False, True) I can't think of a way how to show the error message promptly after you selected an end date that is earlier than a start date. Maybe with some custom code it's possible but I can't think of any method how to solve that.-
Free Windows Admin Tool Kit Click here and download it now
September 19th, 2012 8:35am

Hi John, In current release of Reporting Services, it is not supported to customize the error message displayed in the "Parameter Error" prompt window. According to your description, Eriks suggestion is the best approach to work around the issue. A little improve for Eriks workaround, you neednt to create extra parameter, just set the visibility of the two rectangles to: =IIF(Parameters!StartDate.Value>Parameters!EndDate.Value,False,True) and =IIF(Parameters!StartDate.Value>Parameters!EndDate.Value,True,False) If you have any questions, please feel free to ask. Regards, Charlie Liao
September 20th, 2012 1:52am

Hi John, In current release of Reporting Services, it is not supported to customize the error message displayed in the "Parameter Error" prompt window. According to your description, Eriks suggestion is the best approach to work around the issue. A little improve for Eriks workaround, you neednt to create extra parameter, just set the visibility of the two rectangles to: =IIF(Parameters!StartDate.Value>Parameters!EndDate.Value,False,True) and =IIF(Parameters!StartDate.Value>Parameters!EndDate.Value,True,False) If you have any questions, please feel free to ask. Regards, Charlie Liao
Free Windows Admin Tool Kit Click here and download it now
September 20th, 2012 1:53am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics