Friday, March 9, 2012

Is there any way to show or hide the Document Map dynamically depend on parameters?

hi, all
I have a class report with class no as paramter.
This parameter could be null. So, if users enter null, it will show all of them for all classes. Otherwise, it will only show the data for that class.
So, what I am thinking about is, if the parameter is null, report shows all data, it will be very nice to show the Document Map on the left side. If users entered class no, then there is only one class in this report, no use to show or use the Document map, right?
Does anyone know how to do that?

If you are using the ReportViewer controls that shipped with VS 2005, you can read the values of the parameters from ReportViewer.ServerReport.GetParameters (or LocalReport depending on the mode you are using) and set ReportViewer.DocumentMapCollapsed programmatically.

If you are using url access to the server, you could use rc:DocMap=false to hide the document map, but this would require you knowing the value of the parameter beforehand, so it wouldn't work with the built-in parameter prompting.

No comments:

Post a Comment