SSRS report parameter.label showing parameter.value
Asked Answered
R

2

18

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)

Repetitious answered 19/2, 2013 at 14:26 Comment(3)
I have the same environment (MS SQL 2008R2 SP1) but can't reproduce this. Is there some additional information?Monophthong
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.Repetitious
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.Enzyme
G
31

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.

Grubby answered 19/2, 2013 at 15:2 Comment(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.Enzyme
=Parameters!<ParameterName>.Label(0) this works for me. Thank you.Latvia
P
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.

Petulancy answered 6/8, 2014 at 21:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.