SSRS Multi Value Parameter - reporting-services

I have a report having two tab-lix and also two data set(e.g=dataset1,dataset2) for each tab-lix. When i am generating report by passing the multiple parameter location id(38,39 & 40) value if there is no record of id-38 in dataset2 i want blank space but in my report it is showing report of 39. But i want if there is no data in data set based on the parameter it is showing only blank space.Because always dataset1 having data and so it showing properly.When i am generating report with multiple parameter(38,39,40) it showing tablix1 of 38 parameter but tablix2 of 39 parameter in on page because of there is no data in dataset2 of 38 parameter.So i want to display a blank space on behalf of tablix2 if there is no data.
Give me a solution.

This answer assumes you have a table that contains all locations e.g. DimLocations, if not you should consider creating one.
You can then change your dataset query to be something like.
SELECT loc.LocationID, t.SomeColumn, t.AnotherColumn
FROM DimLocations loc
LEFT JOIN myTable t ON loc.LocationID = t.LocationID
WHERE loc.LocationID IN(#myLocationParameter)
This will ensure that you get a record for each location as long as it appears in the DimLocations table.
If this does not help, edit your question to show the dataset query you are using now and the structure of your locations table (if you have one)

Related

How can I append the results of additional queries to an SSRS report?

I am generating an SSRS report whose results are displayed like so:
I need to append similar query results (same exact query, one different parameter value) to the right of this data, so that one additional result set of data (from a 2nd query) would look something like this (but with different data, of course - this is just copied-and-pasted to show what's needed):
How can I add multiple of these similar-but-distinct result sets so that they can be read from left to right as shown above?
Solution: COLUMN GROUPING
If I have understood your question correctly, you are expecting to show those 3 columns repeatedly for different set of values. All you need to do is put those 3 columns in a group (Column Group) and Group by on whatever "Field/Parameter" you want to it repeat. Let me know how it goes!!
Based on what is written here, this is how I accomplished this:
I created a new report based on the existing one, and then added a Subreport and then dragged the existing (original) report onto it (I dragged "VariancePricebyProduct_Facelift.rdl" onto the subreport in "VariancePricebyProduct_Facelift_WithSubreports.rdl"). Then I selected the context menu item "Subreport Properties" and added a parameter ("Unit"), providing it with a "hard-coded/baked-in" value ("CHOPHOUSE") different from the one to be provided by the user for the main report.
Then, since I want to keep the same date values from the existing report, I added two more parameters to the subreport and set them to use the same values for the date range as those used there in the main report by selecting the "formula" ("fx") button and 2-clicking the appropriate parameter to be used as the passed-in (tramp) value:
That works. Just to make it plainer, here is how it looks at design time:
The mess at the top is "VariancePricebyProduct_Facelift.rdl"; the bit below is a Textbox/Label for the subreport and then the subreport itself.
And here is how the data looks where the original/base report finishes and the subreport begins:

Applying different Visibility to each Tablix

I have a report showing hours and dollars that are written off. Jobs for this report are classified as NRB (non-billable) and non-NRB (billable). Each job type has its own Tablix in the report and I want to populate each Tablix based on a bit value - IsNRB.
All of the "0" IsNRB rows should populate the top Tablix and the "1" values should populate the bottom Tablix . For the most part this is working. What is happening, however, is that some Programs or Clients will have both NRB and non-NRB jobs, and it appears that as each Tablix works its way through the rows of the report dataset, it will capture and retain the first value for IsNRB and apply that to the entire report.
I have tried logic similar to the following in a number of places/ways:
=IIF(Fields!IsNRB.Value = False, Fields!CustProgram.Value, NOTHING)
The Grouping hierarchy of the report looks like this:
ProgramGroup
ClientGroup
Job/SubJobGroup
Detail is here
I have tried setting evaluative expressions similar to the one above on TablixVisibility, GroupVisibility, RowVisibility, and in the field expression itself. The behavior seems consistent in that the first row for that Program, Client, or Job sets the value of IsNRB for the entire report.
As a concrete example, the first Program, "Cascadia" has three rows where IsNRB = 1/True and two where IsNRB = 0/False, and the latter two rows of data are always misapplied because the value of 1/True is overriding the 0/False valued rows.
What is the proper approach to take that will allow the first Tablix to accept and display rows of data where IsNRB = 0 and the second Tablix to show those with a value of 1? Do I need to abandon the IsNRB bit datatype and just have a distinct dataset for each Tablix? That seems like a klunky way to approach the report.
Filter each table on the IsNRB field. Right click the tablix and select Tablix Properties. Select filter, then then select the field you want to filter against (IsNRB) and the value your want it to be (1).
This will put all records with a 1 for the field in one table, and with a 0 in the other

SSRS-DT 2012 Report from 2 Data Sources

I'm learning to use SSRS-DT 2012
I need to write a report about assets.
DataSource 1 - View that contains a relationship between a hierarchy number code (AB123) and the name of the hierarchy (Accounting)
DataSource 2 - View that contains the data about the assets and the hierarchy number (AB123).
I'd like the report to contain the Hierarchy Name and the Asset details.
I think this is a Lookup, have been getting confused on how to write it b/c in SSRS-DT you write a query as a property of a dataset (If I'm wording that correctly) - I don't know how to write a query that involves 2 data sources.
Am I missing something?
Use this expression:
=lookup(Fields!HierarchyCode.Value,
Fiedls!HierachyCode.Value,Fields!AssetsDescr.Value,"DataSet2")
As example I have these datasets:
Maybe you want to use a tablix for show this report, so I've added one with this data arrangement.
First column has Descr field of my DataSet1, the expression at right is used to join it to my DataSet2 and return the value that corresponds.
This is my expression:
=lookup(Fields!Month.Value,Fields!Month.Value,Fields!Total.Value,"DataSet2")
Note tablix DatasetName property was set to DataSet1
This will preview the following tablix:
Using the lookup function I am getting the corresponding total value from DataSet2 for every Month in the DataSet1.
For more information check lookup

In SSRS is there a way to make a Row Group expand based on parameter value?

I've got a table with 5 columns, the first 3 of which allow the user to drill down through the levels of detail. Each of these columns (Region, Country & Office) has an associated Parameter so the user can select the geographic region for their report. Each parameter allows the selection of multiple values.
If the user selects 1 Region, 1 Country and 1 Office it's not exactly ideal for them to then have to expand each selection. Is there an expression I can enter somewhere to state that if only 1 value is entered in a parameter then that data set will automatically show as expanded?
This is in SSRS 2008 R2 if that makes any difference.
In the Group Properties for the detail group you can enter an expression for the initial visibility. Right now you probably have that set to "Hide." The expression needs to return a Boolean and could be something like:
=Parameters!Country.Count <> 1
This will have SSRS hide those rows if more (or less) than one value are selected in the parameter Country
But I have seen some unexpected results with this: test thoroughly. In my experience, BIDS handles these better than SSRS itself, so just when you think you've got it all working, it fails miserably once deployed. (Reason number 14 to have a test folder on production SSRS.)

Display data in SSRS

I have two tables on the SSRS report which displays data depending on the results returned by a single dataset.
The second table displays a subset of data which is displayed on the first depending on some parameters.Now I would like to implement a functionality which displays "no rows" in the second table if the countrows=0 (subset returned from first table) and display the data(subset of data in the first table) if the countrows>0
How can I implement this?
There is a property on the table called "NoRows" that allows you to enter any text you want to show if there are no rows returned.
you can also use this solution:
for your dataset2 click the tablix and at the bottom you shall have Row groups. Click on each of the row groups. So if you have 1 child and 1 parent you will have to do this on both.
1) Right click group_child->group properties->filters and put the following expression "=IsNothing(Fields!Group_Child.Value)="True"" "; set it as boolean expression and 'value'='False' and you will have to do same for Group_parent1 thru n.
This will display NO rows if you have NO data for bottom dataset. If this is the same thing you want to do with Tablix 1 go for it.