17

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)

alexlz
  • 548
  • 1
  • 7
  • 22
alphaprolix
  • 601
  • 2
  • 10
  • 24
  • I have the same environment (MS SQL 2008R2 SP1) but can't reproduce this. Is there some additional information? – Roman Badiornyi Feb 19 '13 at 14:31
  • Im am using visual studio 2010 to develop SSRS report, In my Visual Studio I have installed Development Tools For MS AX 2012, this is SSRS report for AX 2012. – alphaprolix Feb 19 '13 at 14:35
  • I think its a bug. I am also having a parameter kpi_id with value & label but when I use parameter.label in my chart title, it shows me value not label. Its single value parameter. – Aditya Jan 24 '14 at 04:50

2 Answers2

28

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.

Gil Peretz
  • 2,259
  • 6
  • 25
  • 43
  • 2
    H @GilPeretz It's not working for me. I think its a bug. I am also having a parameter kpi_id with value & label but when I use parameter.label in my chart title, it shows me value not label. Its single value parameter. – Aditya Jan 24 '14 at 04:51
  • =Parameters!.Label(0) this works for me. Thank you. – Rahul Patil Jan 14 '19 at 18:11
3

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.

Community
  • 1
  • 1
Charlie Wynn
  • 927
  • 1
  • 7
  • 18