Saturday, February 25, 2012

Please help. How to set a Parameter in SSRS in runtime? Parameters!myParam.Value property is rea

You can set the default value of a reporting services parameter by any expression.

But with code I'm NOT allowed to do:

Parameters!myParam.Value = CDate("01.01.2007")

This is cause Value property is read-only.

So the question would be:

Are there any way I set a parameter value in runtime ?

Hope anyone can help...

Use VB.Net or C# code (Report -> Report Properties -> Code tab) to store the parameter in some shared variable. Use this variable to set and retrieve value whenever and wherever you need in the report by using the syntax Code.MySharedVar

Shyam

|||

Hi Shyam,

I have tried that also, but the problem is that the calendar control turn into a drop-down combo control when you apply either code or connect it to a dataset.

The parameter is a datetime type. As long as you add logic to the "default value" it showns the calendar control, if you add anything to "available values" the calendar disappears and a combo is shown. Any ida what I can do to keep it displaying the calendar control ?

|||

I guess you are raising a new issue now. I dont think your issue can be solved at the reporting services level.

No comments:

Post a Comment