Date format validation in SSRS
How to do validate the correct date format in SSRS? Currently I am using SSRS 2008. Is it possible to pop-up a message saying 'Invalid Date Format', if the date input parameter does not contain correct date format i.e. mm/dd/yyyy ? Can anybody help ? Thanks in advance. tap_ks
May 3rd, 2011 4:48am

Within SSRS report it is not possible to show a pop up message. However, you can add a textbox in the report body with its text set to show the error message when validation fails. You can sets its font in red to draw attention. Then use an expression in the visibility property of the table and hide the table when the validation fails. Similarly show the error message text box when the validation with the expression succeeds. As such, when the report is run, either the table having data or the error message box (only one of them) will be displayed. However, you can create a custom .net windows application to read the inputs and show the report using report viewer. In this method, you can validate and show pop up error messages when validation fails. But this method requires the development efforts in the building the UI. Hope this helps. Please feel free to discuss for further help. Please click "Mark as Answer" if this resolves your problem or "Vote as Helpful" if you find it helpful. BH
Free Windows Admin Tool Kit Click here and download it now
May 3rd, 2011 5:29am

Thanks Bilal for suggesting an alternative solution. However, while entering a wrong date format in the Date input parameter, it shows a message saying "The value provided for the report parameter 'Dt_Start' is not valid for its type', which is appearing before clicking on 'View Report' button. So how to implement your 1st suggestion. Can you please help me? tap_ks
May 3rd, 2011 6:05am

Once the data type of the parameter is defined as date, SSRS will handle the validation to check if its a valid date. If you need to skip, then you will have to set the data type of the parameter as text. However I guess utilizing the SSRS validation is preferable. When you need to perform some custom validations, like you allow entry of range of date, you want to check the from date not be after the to date, in such situation, you would not get validation within SSRS. In handling such validations, above method would become handy. Hope this helps. Please click "Mark as Answer" if this resolves your problem or "Vote as Helpful" if you find it helpful. BH
Free Windows Admin Tool Kit Click here and download it now
May 4th, 2011 4:26am

So how to implement your 1st suggestion. Can you please help me? Hi tap_ks, From your description, you want to implement this scenario. Generally, we can use custom code to validate the date which is input in the parameter textbox. Please refer to the similar thread below: http://social.msdn.microsoft.com/Forums/en-CA/sqlreportingservices/thread/cfa27e92-9b88-421f-9473-84b0a6cca63a If you have any question, please feel free to ask. Regards, Bin Long
May 4th, 2011 5:55am

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

Other recent topics Other recent topics