Parameter![paramname].label (0) = #error - visual-studio-2010

im using a visual studio expression
=parameter!site.label(0)
the user can select all/ multiple values for this parameter
but the parameter is only showing the first one
say user selected all (birm,londn,leeds)
the field should say birm, londn,leeds but it only says birm

If you want to display multi parameter selections then do this
=Join(Parameters!xxxxxxx.Value,",")

Related

How pull in fields value from created parameter

I created a parameter [GroupID] that is used to query several datasets in my SSRS report. It is using the field [GroupID] from my GroupList_Rolling12 dataset. An example of [GroupID] is 77610N. When 77610N is selected, all of my datasets are correctly 'filtering' for this [GroupID].
I now need to create a text box that returns the [GroupName] of [GroupID]. In other words, when 77610N is selected from my GroupID parameter, I want the [GroupName] that is associated with the selected GroupID parameter to display.
I'm still very new to SSRS and cannot figure this out. I tried creating the expression =First(Fields!GroupName.Value, "GroupList_Rolling12") but that did not work since it simply returns the first value from the query.
I also tried =First(Parameters!GroupID.Value(0)) but this also did not work
I also tried this expression =Lookup(Fields!GroupID.Value, Fields!GroupID.Value, Fields!GroupName.Value, "GroupList_Rolling12")
)
Can you please help?
You can reference the parameter label directly like this
=Parameters!GroupID.Label
There is no need to put the index on the end (=Parameters!GroupID.Label(0)) unless your parameter is multi-value, in which case it would select the first selected entry.

Trying to generate SSRS report based on input parameters in visual studio

I have an AX query dataset that I'm trying to use to generate an SSRS report. I want to the user to be able to enter 2 parameters (Date and ProjectId) and have the SSRS report return a table based on the query using the parameters inputted by the user. Can't write any code so it needs to be purely graphical.
You can simply add your parameters to query as query ranges.
In the AOT, click Queries, and locate the query that you want to define a range for.
Expand the query, click Data Sources, and then expand a data source.
Right-click Ranges, and then click New Range.
Right-click the new range, click Properties, and then select a field in the Field property list.
Type an expression in the Value property to specify which records are retrieved.
here it's a helpful link for creating queries with ranges:
https://msdn.microsoft.com/en-us/library/bb314753.aspx
Here is a walkthrough to follow:
https://technet.microsoft.com/en-us/library/cc636713.aspx

SSRS show parameter values in header

I am trying to add an expression in header section, which would display parameter value chosen by users (if everything selected, display "ALL" instead). I am having trouble with "Property" parameter.
Report structure:
Report is a matrix report that shows data by year and grouped by refBuildingID. Parameter "Property" is based on RefBuildingID. I want to show these parameter values in header when users run this report.
Expression:
=IIF(Countrows("BuildingID")=(Parameters!refBuildingID.Count),"All",Join(Parameters!refBuildingID.Value,", "))
Error:
The Value expression for the text box ‘Textbox31’ has a scope parameter that is not valid for an aggregate function. The scope parameter must be set to a string constant that is equal to either the name of a containing group, the name of a containing data region, or the name of a dataset.
Is there a way to get around this error?
Try this method:
=IIF(Count("BuildingID")=Count(Parameters!refBuildingID.Value),"All",Join(Parameters!refBuildingID.Value,", "))
i think CountRows will work
=IIF(COUNTROWS("BuildingID").Equals(Parameters!refBuildingID.Count),"ALL",Join(Parameters!refBuildingID.Value,", "))

Use SSRS Expression to Hide Tablix Based on Parameter Selection

I have a report that displays sales by county or by agent - but the user cannot select both. The #AgentOrCounty parameter is hard-coded: Agent = 0 and County = 1. And the #AgentID parameter only accepts one value but the #CountyID accepts multiple values. And my report has two tablixes: one for the dataset and one to display an error message if the user selects both an #AgentID and #CountyID
What I hope someone can help me with is how I can write two expressions to hide the tablixes based on the user selection.
One additional issue I am experiencing is that the #CountyID parameter is a multi-value parameter that I have to pass a NULL value to to allow the report to run if the user wishes to display by Agent.
Right now, on my Error Message tablix, I have the following expression:
=IIF(LEN(Parameters!AgentOrCounty.Value)=0,TRUE,FALSE) OR IIF(LEN(Parameters!AgentID.Value)=0,TRUE,FALSE)
But this doesn't hide the Error Message tablix when the user runs the report correctly for Agents.
When I think in logical terms, I would like the Error Message table to be hidden if the #AgentOrCountyID = 0 and #CountyID is NULL or the #AgentOrCountyID = 1 and #AgentID is NULL.
And I would like the report data tablix to be hidden if #CountyID and #AgentID are both not NULL.
Any suggestions?
To hide the error message tablix, I used the following expression:
=IIF((Parameters!AgentOrCounty.Value=0 And Parameters!CountyID.Value(0)="NULL")
Or (Parameters!AgentOrCounty.Value=1 And Parameters!AgentID.Value Is Nothing),True,False)
And to hide my data set tablix when the user selected both an agent and a county, I used the following expression:
=IIF(Len(Parameters!AgentID.Value)>0 And Len(Parameters!CountyID.Value(0))>0,True,False)

How to hide certain values in SQL Reporting Services

I am creating a report in SSRS 2005 and where there should be a NULL value in the table it is returning a value ("Alle" [the tables are mostly in German]). This isn't really a problem as I think I can hide the value as explained here:
How to hide certain on SQL Reporting Services 2005
However, when I add =Replace(Fields!LengthofFunding.Value,"Alle","") to the Expression box in the field I want to hide the value for it is returning a FALSE value rather than a blank.
Can anyone let me know how I can make this field return a blank value?
I think instead of replace you can use the Iif as following:
=Iif(Fields!LengthofFunding.Value = "Alle", " " , Fields!LengthofFunding.Value )
This means if its equal to "Alle" replace with blank, else keep the original value.

Resources