Date report parameter validation issue

  • Hi,

    I am trying to validate report paraters which are calendar dates. I am checking the logic for end date should not be less than start date. My code snippet is as follows:

    Function CheckSignificantDate(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

    First time when you run the report, it works. But if I run the report second time, it does not give error and report start processing.

    Can we add validation somewhere in report that will validate the parameter for every run?

  • SSRS as such doesn't allow validations of parameters. But you may handle this using expressions to some extent. If your parameter meets certain criteria, then only assign dataset or set visibility to true, and so on.

    Another way would be creating a custom page (may be .aspx) and call report within that. Not sure, it covers under your application scope.

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

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