Monday, March 12, 2012

Parameters visibility

Hi,

In Report Parameters, there is a settings "Hidden". Once it is clicked, the parameter will be hidden from users.

However, can I make its visibility according to some conditions? Such as when some items in the reports being clicked, or when the parameter drop down list only contain one option?

Thanks in advance.

If you are using the reportviewer controls, you can do this by using the ReportViewer.ServerReport.SetParameters method. The ReportParameter object has a property for visibility.

|||Can you elaborate on this? I'm not sure how/where to use the SetParameters method.

I assumed there would be the ability to use expressions for parameter visibility.
|||

There are two places you can control parameter visibility.

The first is from the report definition itself. This is the hidden flag you mentioned. This setting is constant for the report and can't be set to an expression.

The second place to set visibility depends on how you are viewing the report. If you are using URL access directly to the report server or Report Manager, you can't set parameter visibility on an individual parameters basis (you can turn off the entire parameters area using url access to the server). If you are using the ReportViewer controls (either winforms or webforms) that ship with VS 2005, you can use the ReportViewer.ServerReport.SetParameters() call to tell the control to override the visibility setting in the definition. Note that you can only force the parameter hidden, you can't force a parameter to be visible if the report definition has hidden set.

No comments:

Post a Comment