Tuesday, March 20, 2012

Parameters: Users must choose one or both parameters

I have two date parameters in my report. The user must make a selction on at
least one of the two parameters (either one), but does not have to make a
selection on both.
How do I verify that at least one parameters has a value? I guess this must
be verified on a pre-Execute event on the View Report button.
Thanks in advance for your help.Allow Null on both dates. Then in your sproc (which is essentially what the
query turns into) check both are not null, else raise an error.
--
William Stacey [MVP]
"Billy" <Billy@.discussions.microsoft.com> wrote in message
news:0F4F4ED4-CF0F-4955-8265-EC47576F0186@.microsoft.com...
|I have two date parameters in my report. The user must make a selction on
at
| least one of the two parameters (either one), but does not have to make a
| selection on both.
|
| How do I verify that at least one parameters has a value? I guess this
must
| be verified on a pre-Execute event on the View Report button.
|
| Thanks in advance for your help.|||Do I understand you correct when I sum up your answer like this:
In the receiving procedure on the SQL Server I will have to check if at
least one of the two parameters has a value. If not I raise an error in the
stored procedure. This error is automatically caught by Reporting Services
and displayed to the end user.
"William Stacey [MVP]" wrote:
> Allow Null on both dates. Then in your sproc (which is essentially what the
> query turns into) check both are not null, else raise an error.
> --
> William Stacey [MVP]
> "Billy" <Billy@.discussions.microsoft.com> wrote in message
> news:0F4F4ED4-CF0F-4955-8265-EC47576F0186@.microsoft.com...
> |I have two date parameters in my report. The user must make a selction on
> at
> | least one of the two parameters (either one), but does not have to make a
> | selection on both.
> |
> | How do I verify that at least one parameters has a value? I guess this
> must
> | be verified on a pre-Execute event on the View Report button.
> |
> | Thanks in advance for your help.
>
>|||Right. And the report page will display the error text as you entered it.
A dialog box would be better (maybe), but that is what we have.
--
William Stacey [MVP]
"Billy" <Billy@.discussions.microsoft.com> wrote in message
news:9A2E1E77-BC99-466C-A856-F4DD48DD2B64@.microsoft.com...
| Do I understand you correct when I sum up your answer like this:
|
| In the receiving procedure on the SQL Server I will have to check if at
| least one of the two parameters has a value. If not I raise an error in
the
| stored procedure. This error is automatically caught by Reporting Services
| and displayed to the end user.
|
|
|
|
| "William Stacey [MVP]" wrote:
|
| > Allow Null on both dates. Then in your sproc (which is essentially what
the
| > query turns into) check both are not null, else raise an error.
| >
| > --
| > William Stacey [MVP]
| >
| > "Billy" <Billy@.discussions.microsoft.com> wrote in message
| > news:0F4F4ED4-CF0F-4955-8265-EC47576F0186@.microsoft.com...
| > |I have two date parameters in my report. The user must make a selction
on
| > at
| > | least one of the two parameters (either one), but does not have to
make a
| > | selection on both.
| > |
| > | How do I verify that at least one parameters has a value? I guess this
| > must
| > | be verified on a pre-Execute event on the View Report button.
| > |
| > | Thanks in advance for your help.
| >
| >
| >

No comments:

Post a Comment