mikesnp

The article "Using Parameters in Expressions" in SQL Server 2005 Books Online
(http://msdn2.microsoft.com/en-us/library/aa337293.aspx) discusses various properties of Multivalue Parameters, for instance:

=Parameters!<MultivalueParameterName>.IsMultiValue

What I don't see is a property that exposes the True/False value of the (Select All) option. Obviously, the reportViewer is aware of this value, but it does not appear exposed in the API. We are very interested in evaluating if the user has selected the (Select All) option.

MSFT...Might this be one of the features in the SP1 update, but not yet documented in Books online

Thanks - Mike



Re: Visual Studio Report Controls Is there a Multivalue property for (Select All)

Robert Bruckner MSFT

The .IsMultiValue property is available for RDL expressions inside the report. It is also exposed on the ReportViewer API through ReportParameterInfo. Btw, if you are using the ReportViewer control in local mode, you have to do the parameter UI handling yourself anyway.

-- Robert






Re: Visual Studio Report Controls Is there a Multivalue property for (Select All)

mikesnp

Hi Robert,

I think you have misunderstood my question. That, or I have not stated it well.

We are aware of the .IsMultiValue property. This only tells us that the parameter is multi-value True or False. What we are looking for is a property that tells us if the user has checked (Select All) for a multivalue parameter.

Thanks - Mike





Re: Visual Studio Report Controls Is there a Multivalue property for (Select All)

Robert Bruckner MSFT

The "(Select All)" item is just a UI shortcut element. Therefore that piece of information is not sent to the RS processing engine and not available in the ReportObjectModel to RDL expressions.

I think one way of achieving what you are looking for is to compare the CountRows of the dataset that is used for the valid values list of the multi value parameter (e.g. =CountRows("DataSet1")) and the Count of the selected parameter values (i.e. =Parameters!P1.Count).

-- Robert






Re: Visual Studio Report Controls Is there a Multivalue property for (Select All)

mikesnp

Hi Bruce,

When we set another parameter to the count of the dataset, the data set is requeried. Big performance drag. I believe this has been discussed in other threads.

What we have resolved to do is this...

Some background about our report (simplified):

1. Parameter Name = StaffID
2. StaffID Dataset = lsp_GetStaff (a stored procedure)
3. Report has one table with dataset = lsp_GetStaffProductivity
4. lsp_GetStaffProductivity is passed StaffID, which we declare as @StaffID

The Problem

If the user checks (select all) Staff, we want to prevent the execution of the line

WHERE StaffID IN @StaffID

in our stored proc lsp_GetStaffProductivity

The Resolution:

1. In lsp_GetStaffProductivity, we declare two parameters:

@StaffIDCount = udf_GetCountFromList(@StaffID)

@lsp_GetStaffCount = Select Count(StaffID) From Staff

Then

if @StaffIDCount <> @lsp_GetStaffCount

BEGIN
WHERE StaffID IN @StaffID
END

Now, What We'd like from Microsoft...

Ability to set a parameter in the report to the value of (Select All), e.g. SelectAll = Parameters.StaffID.SelectAll. That way we can simply pass this value to the report's stored proc. So, in the sp we can write...

if @SelectAll = False

BEGIN
WHERE StaffID IN @StaffID
END

BTW, I am aware of the UNION alternative where the "All" choice is user defined. This is not acceptable for us. We have several cases where the user likes to check Select All in order to auto check all the selections (there can be dozens), and then unchecks just a few.

I am open to other suggestions from the community and I hope my experience helps others.

Thanks - Mike