I’m new to SSRS, so I apologize if this question is too simple:
I have a report which accepts a parameter called ‘Amount’. I want to constrain valid inputs to currency values >= 0, and pop open an error message if the user enters improper values.
I don’t want to validate inputs in my stored procedure and throw exceptions, because SSRS displays a very generic ‘Query execution failed for ‘someTable” message to users who access the report from another machine, and my business does not want to turn on the ‘Enable Remote Errors’ flag.
How do I add input validation to report parameters and notify users of bad input?
Yes, I’ve googled around, but haven’t had much luck. Thanks in advance 🙂
Okay, how about this?
All you have in SSRS, really, is the SQL query and expressions in report fields.
Perhaps you could add a big, red text box at the top of the report for your error message, and give it an expression like ‘=IIf(Parameters!Amount.Value < 0, ‘Error: Invalid Amount’, ”)’.
Then go to your table’s ‘Hidden’ property and give it the expression ‘=Parameters!Amount.Value < 0’
You could also add into your query’s where clause and add ‘AND @Amount >= 0’ so you aren’t fetching from the database when there’s an error.