Sunday, June 2, 2013

Textbox message

Hi, I'm working with SQL Server Reporting Services 2005.


I have a report with a dataset that gets data from a SQL Server database. Also, I have two report parameters of type DateTime (StartDate_param and EndDate_param) which the user selects on the report.


I have set a restriction if the user picks dates with different months, for example june 1 and may 3, the process stops:


I have this code on the Report Properties-----Code section to manage the restriction:



Public Function ValidateDate(StartDate As DateTime, EndDate As DateTime) As DateTime
If (DateDiff(DateInterval.Month, StartDate, EndDate) <> 0) Then
Err.Raise(6,Report)
End If
End Function

and I have set a hidden parameter CheckDateRange which calls the ValidateDate function with this expression:



= Code.ValidateDate(Parameters!StartDate_param .Value, Parameters!EndDate_param .Value)

This stops the SQL processing and i get this error when entering dates with different months:

"Error during processing of 'CheckDateRange' report parameter"

But I would like to show a message on a Textbox instead of the message that's showing now, how can I do that?


if that is not possible, what could I do in that case?.



thanks..


No comments:

Post a Comment