Wednesday, March 28, 2012

Report Parameter Default Value from Column

DataSet2:
select MyCol1 from MySecondTable
In the Report Parameters dialog box, I add MyCol1 as a multi-value
parameter. When I run the report, I can select one or more values from the
MyCol1 drop-down. This works great.
The problem is I want the first value in MyCol1 to be the default value in
the drop-down. In the Default Values box, I select Non-queried, and use the
expression =Parameters!MyCol1.Value(0) This seems exactly right to me.
With the default value set as above, the report fails to run with the
following error: Error during processing of 'MyCol1' report parameter.
Any suggestions on how to fix this?
Thanks,
--
RandyYou can create a hidden parameter but not multi-valued. Set its default
value as coming from a query and select MyCol1 in DataSet2, it should pull
the first value from the dataset. Then you can set the default value of the
multi-valued parameter to the value of the hidden parameter.
"randy1200" wrote:
> DataSet2:
> select MyCol1 from MySecondTable
> In the Report Parameters dialog box, I add MyCol1 as a multi-value
> parameter. When I run the report, I can select one or more values from the
> MyCol1 drop-down. This works great.
> The problem is I want the first value in MyCol1 to be the default value in
> the drop-down. In the Default Values box, I select Non-queried, and use the
> expression =Parameters!MyCol1.Value(0) This seems exactly right to me.
> With the default value set as above, the report fails to run with the
> following error: Error during processing of 'MyCol1' report parameter.
> Any suggestions on how to fix this?
> Thanks,
> --
> Randy|||I have done this by creating another dataset called someting like
MyCol1Default defined as:
SELECT TOP1 MyCol1 FROM MySecondTable
or
SELECT MIN(MyCol1) FROM MySecondTable
Then in the report parameter definition specify that the default comes from
dataset MyCol1Default and that the value is MyCol1.
HTH,
Magendo_man
"randy1200" wrote:
> DataSet2:
> select MyCol1 from MySecondTable
> In the Report Parameters dialog box, I add MyCol1 as a multi-value
> parameter. When I run the report, I can select one or more values from the
> MyCol1 drop-down. This works great.
> The problem is I want the first value in MyCol1 to be the default value in
> the drop-down. In the Default Values box, I select Non-queried, and use the
> expression =Parameters!MyCol1.Value(0) This seems exactly right to me.
> With the default value set as above, the report fails to run with the
> following error: Error during processing of 'MyCol1' report parameter.
> Any suggestions on how to fix this?
> Thanks,
> --
> Randy

No comments:

Post a Comment