SSRS report parameter.label showing parameter.value - ssrs-2008

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)

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.

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.

Related

Crystal Report: Parameter damages the whole report

While using Crystal Reports I have encountered a strange bug, that repeats itself already with a number of my reports.
I still didn't fully get how I replicate it, but usually it goes as follows:
I add a parameter of any type to an existing report document, however it doesn't appear in a parameter prompt at all.
After I change parameter order in the Parameter Fields Section, my Parameter disappears and instead I see a duplicate of another parameter in a parameter list, and in the "Set Parameter Order"-Window I see this duplicated parameter as [ParameterName, ParameterName]. If I save the document in this moment and try to reopen it, CR crushes.
If I try to load this document in Vstudio with CREngine, the code exits with the message "Access violation".
Here is a pic of what is happening:
The reason you are not being prompted for the new "test" parameter is that it is not used by the report for anything.
The rest of the behavior is indeed strange. Consider removing the '#' character from the name of the first parameter to see if that fixes it.
If some of those parameters are from a stored procedure, perhaps your report is simply out of sync with the data source. Do Database, Verify Database...

my report run but does not display anything in oracle

I have designed report in 10g. When I call report through forms 10g than report executed but do not display anything. Kindly help me what I have to do to resolve this issue. I use .rep report and desformat is PDF. One thing more when in this desformat my report started downloading instead of giving a preview in internet explorer and downloaded pdf is empty (contain nothing).
Report displays the result of a query. So the most obvious question is: does the query, when you run it outside of the Forms/Reports application, work correctly and returns the result?
If it accepts certain parameters, verify that they are correctly passed. Mind the datatype, especially if DATE is involved as people usually have problems with different format masks, NLS settings and stuff.
Also, check whether those parameters are obligatory or not. If not, report's query should contain something like
where (some_value = :parameter_value or :parameter_value is null)
Furthermore, make sure that all those parameters are passed to the report. You can display their values in the report, just to see what's going on. Open Reports Paper Layout Editor, go to the margin and - using the ampersand notation - display those values, such as
Parameter one = &parameter_one
Parameter two = &parameter_two

SAP Central Management Console Parameters not aligned

I have been designing Crystal Reports, and publishing them to the SAP Central Management Console, for the past couple of years; but I have never come across this really strange issue before!
The report in question has 7 Parameters:
1 is a static String Parameter,
1 is a static Date Range Parameter
3 are static Number Parameters
1 is a static String Parameter with a pre-defined list of values
1 is a multi-level dynamic String Parameter
All of these parameters work fine when running reports from the Designer application itself, but as soon as it's published to the Central Management Console it all messes up:
If you choose the first Parameter, you get the first parameter input screen.
If you choose the second Parameter, you get the first parameter input screen.
If you choose the third Parameter, you get the second parameter input screen.
If you choose the fourth Parameter, you get the third parameter input screen.
etc
This means that there is no way of selecting the 7th Parameter as it shows you the 6th parameter input screen.
This behavior started when I added two of the static Number Parameters. Before this everything worked fine, and I cannot find online documentation/help which would allude to a Parameter limit in CMC.
Crystal Reports Designer Version: Crystal Reports 2008, Version 12.3.0.601
Central Management Console Version: SAP BusinessObjects Enterprise XI, Product 12.1.0
Thanks in advance for any help!
After investigating I realised that the problem was Central Management Console does not interact well with multi-level parameters.
I changed the multi-level parameter to two separate parameters, and everything is working.

Crystal report

Is there a function or any way I could print the username of the user taking the print out of a report in CR 8.5??
This could be the windows user name or user name pertaining to a system like IFS where the reports are being generated from.
If you are using C#, you can pass in System.Environment.Username as a parameter to your report.
EDIT: (Thanks rexem)
If you were using CR V10 and BusinessObjects Enterprise you could look into using CurrentCEUserID in a formula field.

Crystal Reports - Default Parameters

In Crystal reports, you can define default values for the report parameters.
For example, I might have a date range and set a default start of 12/01/2008 and a default end of 12/31/2008.
Is it possible to modify these defaults at runtime? For example:
1 - Default to the first and last days of the current month?
2 - Default to the first and last days of a proprietary company fiscal calendar? (i.e., look it up in a database)
3 - First & Last days of the current year?
You get the point. Is this possible? I'd even be open to a solution that involved running an external application to reach into the reports and modify them, if anyone knows how to do that.
Edit:
To answer the question posed by Philippe Grondier, most of these reports are run from inside an application. I was hoping for something simpler than manipulating the crystal object at runtime; I have my hands full right now with figuring out other parts of that API. I might take a look in the future, though.
Are you planning to run your crystal report from the crystal reports interface or as an add-in embedded in another program (you can for example use the Crystal Reports ActiveX Designer Runtime Support - craxdrt.dll - in VB code) ? In this last case, it is possible to manipulate every object of the report before launching it. Objects such as parameters can then be updated according to your needs.
As a simple example of such runtime update, my report printing routine will allways check if there is a field named "printedBy" in the report. In case this field is found, its value will be settled to the the domain name of the user that requests the report and will be printed out.
At an higher level, you can even reshape the report SQL string to add specific filters that can be inherited from your code. By doing so you might not even need parameters anymore: let your code add the filtering values 'on the fly'
EDIT: some code examples:
(m_rapport is a CRAXDRT.report object, ActiveSession is my current session object)
If m_rapport.ParameterFields.Count > 0 Then
For i = 1 To m_rapport.ParameterFields.Count
If m_rapport.ParameterFields(i).Name = "{?PUB_DateDebutPeriode}" Then
m_rapport.ParameterFields(i).AddCurrentValue CDate(DateValue(sessionActive.dateDebutPeriode))
End If
If m_rapport.ParameterFields(i).Name = "{?PUB_DateFinPeriode}" Then
m_rapport.ParameterFields(i).AddCurrentValue CDate(DateValue(sessionActive.dateFinPeriode))
End If
If m_rapport.ParameterFields(i).Name = "{?PUB_id_Personne}" Then
m_rapport.ParameterFields(i).AddCurrentValue StringFromGUID(clientActif.id_Personne)
End If
Next i
Endif
I also have another function to change report's datasource at runtime, so that reports can be executed on different servers/locations.
Read my posting Crystal Reports: Named-Date-Range Parameters. Maybe you'll be able to leverage this technique for your purposes.