I have 15 Report Parameters. And I have all of them set up as drop downs.
There is going to be times when the user selects all 15 and there are going
to be times when the user might only select 5 or 6 Report Parameters.
I want the parameters to be optional but I also want the parameters to be in
a drop down list.
I tried checking both allow null values and allow blank values in report
parameters.
This works for text box prompts but not for drop down list prompts. I am
being forced to select something from the list even though I do not want to
select anything.
Thanks
PeterI solve this by adding an value to the drop down list "All values".
If your list is based on a query this would be something like (I use oracle,
syntax in SQL-Server might be different):
select Listelement_name, Listelement_value from listelements
union
select "<All Values>", -1 from dual
This way <All values> will always be the first element in the drop down
list, and I put default value = -1.
If you use the parameter as a query parameter you will put:
...and (xxx = @.parameter1 or @.parameter1 = -1) and ...
in the where clause
If it is used for a filter you can f.e. use the switch command:
Switch(Parameters!parameter.value = -1, 1, Parameters!parameter.value =Fields!xxx.value, 1, TRUE, 0) = 1
"Peter" wrote:
> I have 15 Report Parameters. And I have all of them set up as drop downs.
> There is going to be times when the user selects all 15 and there are going
> to be times when the user might only select 5 or 6 Report Parameters.
> I want the parameters to be optional but I also want the parameters to be in
> a drop down list.
> I tried checking both allow null values and allow blank values in report
> parameters.
> This works for text box prompts but not for drop down list prompts. I am
> being forced to select something from the list even though I do not want to
> select anything.
> Thanks
> Peter
>|||That worked Thanks
"Antoon" wrote:
> I solve this by adding an value to the drop down list "All values".
> If your list is based on a query this would be something like (I use oracle,
> syntax in SQL-Server might be different):
> select Listelement_name, Listelement_value from listelements
> union
> select "<All Values>", -1 from dual
> This way <All values> will always be the first element in the drop down
> list, and I put default value = -1.
> If you use the parameter as a query parameter you will put:
> ...and (xxx = @.parameter1 or @.parameter1 = -1) and ...
> in the where clause
> If it is used for a filter you can f.e. use the switch command:
> Switch(Parameters!parameter.value = -1, 1, Parameters!parameter.value => Fields!xxx.value, 1, TRUE, 0) = 1
> "Peter" wrote:
> > I have 15 Report Parameters. And I have all of them set up as drop downs.
> > There is going to be times when the user selects all 15 and there are going
> > to be times when the user might only select 5 or 6 Report Parameters.
> >
> > I want the parameters to be optional but I also want the parameters to be in
> > a drop down list.
> >
> > I tried checking both allow null values and allow blank values in report
> > parameters.
> >
> > This works for text box prompts but not for drop down list prompts. I am
> > being forced to select something from the list even though I do not want to
> > select anything.
> >
> > Thanks
> >
> > Peter
> >
No comments:
Post a Comment