#ERROR displayed when start date > end date

  • Hi,

    I have a bar report that would be display results based on, report user's selection for Startdate [report parameter, datetime data type] and Enddate[ report parameter,datetime data type].

    Problem is, if user selects a startdate greater than the end date.The contents of the chart is empty and a textbox that converts the total values to % values. Displays [#ERROR] sign.

    Is there a way to validate if startdate is lesser than enddate before contents of report is displayed OR prompt user to select a greater enddate.

    Any Advise Pls ?

    [font="TimesNewRoman"] “I haven't failed, I've found 10,000 ways that don't work”........Thomas Alva Edison[/font]

  • I have added this code in report properties> code [to validate startdate > enddate]

    Function CheckDateParameters(StartDate as Date, EndDate as Date) as Integer

    Dim msg as String

    msg = ""

    If (StartDate > EndDate) Then

    msg="Start Date should not be later than End Date"

    End If

    If msg <> "" Then

    MsgBox(msg, 16, "Report Validation")

    Err.Raise(6,Report) 'Raise an overflow

    End If

    End Function

    And added a parameter [Datevalidation] as hidden and connect it to the code above.I came across this method while surfing for some answers

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2069658&SiteID=1http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2069658&SiteID=1

    Now my Validation takes place!:D

    Error displayed as below.

    Error during processing of ‘Datevalidation’ report parameter. (rsReportParameterProcessingError)

    As this is my 1st time working with SSRS, I would like to know if there is any other better suggestions for Error Handling,is it Ok if my users see this error[from user prespective] and when I preview my report in SSRS [SSMS] I get a pop error mssg as well. But once report is deployed I do not get the pop up error.Is there anyway to include the pop up error ?

    Thank You !

    [font="TimesNewRoman"] “I haven't failed, I've found 10,000 ways that don't work”........Thomas Alva Edison[/font]

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply