Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSRS report parameter.label showing parameter.value

I have a SSRS report, in my report I have a dataset which has an ID and NAME field, then I created a parameter and set its value to ID from dataset and Label to NAME of dataset. I can see the label when I preview report and select it, but I am also showing the selected parameter on report for this I am using expression :

=Parameters!P_TargetBrand.Label

But when report runs it is showing parameter VALUE instead of Label.

My SQL version is :

Microsoft SQL Server 2008 R2 (SP1) - 10.50.2550.0 (X64) Jun 11 2012 16:41:53 Copyright (c) Microsoft Corporation Standard Edition (64-bit) on Windows NT 6.1 (Build 7601: Service Pack 1)

like image 629
alphaprolix Avatar asked Feb 19 '13 14:02

alphaprolix


People also ask

What is label field in SSRS?

Now the 'label' field is something that the client sees on the UI as a friendly name. When a client runs the report, it gets executed against the 'value' field and so I was wondering if there was a way to tell SSRS to execute against 'label' field as oppose to 'value'.

How do you pass one parameter value to another parameter in SSRS?

To set available values for the second parameter In the Report Data pane, in the Parameters folder, right-click the first parameter, and then click Parameter Properties. In Name, verify that the name of the parameter is correct. Click Available Values. Click Get values from a query.

How does SSRS deal with multiple valued parameters?

Setting default values for multi-value parameters If we want to set Select All option as a default parameter we need to follow the steps below: Choose Get values from a query under the Default Values tab. Set HRReportParameterDataset into the Dataset Combobox. Set JobTitle field into the Value field.


2 Answers

Case when your parameter is Single Value :

=Parameters!<ParameterName>.Label

Case when your parameter is Multi Values :

=Parameters!<ParameterName>.Label(0)

OR

=Join(Parameters!<MultivalueParameterName>.Label,", ")

For Additional information try here.

like image 137
Gil Peretz Avatar answered Oct 07 '22 18:10

Gil Peretz


I came across this problem and as far as I can tell it is a bug unsupported feature.

On this page - http://technet.microsoft.com/en-us/library/gg731894.aspx

They have two issues that are related to our problem:

"The Label reference does not display properly. The Value property is set to the Parameters!MyParm.Value parameter."

Addtl. Info: "The parameter must be explicitly bound to data using a dataset in the Visual Studio Tools for Microsoft Dynamics AX report model."

and

"The parameter is explicitly bound to datasets with two columns, label and value. The value displays properly. The Label reference displays properly everywhere except in the client."

Addtl. Info: "The report viewer control does not support the ability to specify report parameter labels, only values."


In my case we're not using a bound dataset. Just our own backend and adding the parameter values to the reporting view object. So we're SOL. Really lame that we have to get a label/value pair. Then hit the database again to get the label for the selected value since we don't have direct access to the label.

I would love to be proven wrong.

like image 28
Charlie Wynn Avatar answered Oct 07 '22 20:10

Charlie Wynn