Validity Checking on Report Parameters

  • I would think that wanting to check entries on parameters for their validity would be a common thing.

    I have a report that requires users to enter a start date and an end date. What I would like to do on the end date is require it to be after the start date that has been entered. How can I do that?

  • I have the same question. The reports I am working also have start and end date report parameters, and I would like to make sure that the end date occurs after the start date.

    I'd like to add other checks also before the report runs, like ensuring that a specific report parameter is 10 digits long, or that a report parameter that accepts a year is 4 digits long. The Integer type can be used as the data type, but that can't prevent a user from entering, say 12 or -150, when something reasonable like 2007 is expected.

    The books I have read on SSRS 2005 don't mention report parameter checking at all. I have played with entering invalid data to report, and see that it can catch a bad date for DateTime report parameters, but I'm looking for more than just that.

  • Question. Do your datasets pull all the data and you use the parameters to filter after the fact or do you send the parameters back to the DB before you get the data?

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • Oh, hey....

    If you're sending your params back to the DB, you can do the check in your SQL Code. It's a simple WHERE clause statement.

    But if you need to do the check in the report itself, go to Report Parameters, set the Default Values to "Non-queried" and go into the expression editor. I bet you can do an IIF or some other value check there.

    Another option, if you know scripting, is to go into Report Properties & the code window and take care of the validation at that point. But I can't do scripting very well, so I wouldn't know what code works.

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

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

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