Monday, February 13, 2012

Am I crazy, or is there no form validation for report parameters?

Maybe I am just not using the correct search strings, but it really appears
that there is no server side validation available for parameters in Reporting
Services generated reports? Is this true (so then I can stop looking)?
Thanks for your help.
--
Paul
Web DeveloperYou can do multiple things. First, in layout tab, Report Menu-> Report
Parameters you can set the data type of the parameter. This is a big help
off the bat. Next, realize that you have two different things: query
parameters and report parameters. RS kindof blurs the difference because it
automatically creates report parameters and maps them to the query
parameter. Your query parameter does not have to map directly to a report
parameter. Click on the ... in the dataset tab, parameters. You can map your
query parameter to an expression. This expression could do some additional
massaging of the data, however, it doesn't allow validation per se.
I agree, a validation expression and text that could be associated with a
parameter would be very nice to have.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Paul" <Paul@.discussions.microsoft.com> wrote in message
news:1AA2FCD5-7442-4E01-A0C2-3DBA12758BCD@.microsoft.com...
> Maybe I am just not using the correct search strings, but it really
> appears
> that there is no server side validation available for parameters in
> Reporting
> Services generated reports? Is this true (so then I can stop looking)?
> Thanks for your help.
> --
> Paul
> Web Developer|||Thanks Bruce, the points about the parameter types and expressions does
confirm the understanding I had reached from my research and I feel more
confident that I didn't overlook something that might be more obvious to
others.
--
Paul
Web Developer|||FWIW: I tried to do "validation after the fact" by running some Load code
that validated parameters and, if I didn't like what I saw, throwing an
error with an information message. I couldn't get this to work right (maybe
somebody else has?).
So, instead, I added a textbox with "alert" formatting (red text or
whatever) into the header of the report. It's filled by a variable declared
in the report. Ordinarily it's invisible (empty string). However the Load
code can fill it with its information message to show that there is a
problem.
You could also change the visibility or hide other elements of the report by
using a "Success" boolean variable -- again, ordinarily it has the value
True but the Load code can set it False. Now the entire contents of your
report doesn't show except your error message. There's some other stuff
like that, which does work...
HTH,
>L<
"Paul" <Paul@.discussions.microsoft.com> wrote in message
news:629AC8DC-4FF8-441D-A0A9-04026C652C4C@.microsoft.com...
> Thanks Bruce, the points about the parameter types and expressions does
> confirm the understanding I had reached from my research and I feel more
> confident that I didn't overlook something that might be more obvious to
> others.
> --
> Paul
> Web Developer
>

No comments:

Post a Comment