Applying different Visibility to each Tablix - reporting-services

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

Related

Dont's show rows in SSRS

I'm trying to achieve my report displaying a "No Data Available" message if no results are returned in my query.
I am trying to achieve this via an expression against the Row Visibility.
So I have a Tablix that looks like this -
If there is data available then I want the third, fourth and fifth line to show.
If no data exists then I want the first two rows to display.....
In the Row Visibility for the first two rows I have the following -
=iif(CountRows("RentTransactions") = 0, true, false)
In the Row Visibility for the remaining three rows I have the following -
=iif(CountRows("RentTransactions") > 0, true, false)
I have a filter on the Tablix that just limits it to "AccountType" = Water.
When I run the report between 01/06/2016 and 30/06/2016 - I know there are not transaction - so would expect my report to return the first two rows....
It doesn't it returns the bottom ones , with no data in it??
What am I doing wrong?
The DataSet is definitely called RentTransactions
There are a few issues going on here.
CountRows with the dataset name will always return the total number of rows in the entire dataset.
Row Visibility will make the entire row blank, but it will still take up space. This would look bad if there are alternating blank rows.
What you're really trying to do is control what is displayed in each cell. So in each cell you'll want to have an expression that checks whether or not to display a value. For example, for the Description field it would look something like this:
=IIf(Count(Fields!Transaction_Type.Value) > 0, Fields!Description.Value, "")
This expression will work by returning a count of 0 for NULL Transaction Types. You can customize this if needed.
Also make sure that the query is returning rows for dates with no transactions. Otherwise there's no raw data for the report to do anything with in the first place.

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:

ssrs expression sum doesn't sum all column

I have a column like:
LEFT_PIN_HEIGHT_MIN
0
0
0
1
1
0
I wrote it to Tablix as below,
=Sum(Fields!LEFT_PIN_HEIGHT_MIN.Value)
I want to sum the fields and result must be "2" but it doesn't sum the column
and writes all the rows to Tablix.
I agree with the previous answer that your first choice ought to be to calculate this in the SQL, but sometimes that is not as practical.
Are you trying to display the column's sum in each row? If so, add the dataset name as a second parameter in the sum function, as in
=Sum(Fields!LEFT_PIN_HEIGHT_MIN.Value,"Dataset1")
Replace "Dataset1" with the name of your dataset. The Sum function you're currently using is defining the sum within the context of each row in your tablix. Adding the second parameter changes that context to return the sum for the entire dataset in each row.
If your tablix is large, this may result in a performance hit, since the expression will evaluate each time it is displayed, hence the preference toward doing it in your dataset query.
I suggest to do It with SQL. Use query to SELECT SUM(LEFT_PIN_HEIGHT_MIN)...
If you want to achieve It by SSRS expression you can do It in following:
Right Click on table1_Details_Group > Group Properties...
In Group on: field provide LEFT_PIN_HEIGHT_MIN click OK
To hide 0 > Right Click on left side of values row > Row Visibility check Show or hide based on an expression then write following expression: =IIF(Fields!LEFT_PIN_HEIGHT_MIN.Value = 0, true, false) click OK
It should work.

SSRS. Hide a Column based on Row Group Value

My application uses SSRS to produce payslips for employees. The Payslip report consists of a tablix with 5 columns. Among the 5, is a column called "Units" and another called "Invoice value".
The report has several Row Grouping levels, but the only important one for this question is the Payslip Number Row Grouping "RG_SlipNum". There is a page break after each "RG_SlipNum" RowGroup.
When users want to print Payslips, they can optionally supply up to 5 parameters which filter the result set to print out.
Employees can be paid based on the number of units delivered * a rate (Unit Based), or by a percentage of the invoice value (Invoice based) for the delivery (Oversimplified, but hopefully, you get my drift).
If the employee is Unit based I want the Units Column to Show, and the "Invoice Value" Column to be hidden. If they are Invoice based I want both columns to show.
My dataset has a bit field indicating whether to show or hide a column based on the logic above. It will be a 1 or a 0 for every underlying row within the current rowGroup. I have tried to use the First(,) function in a Column Visibility expression on the "Invoice Value" Column. However, I get the following error whenever I try to limit the scope of the First Function to the current Payslip Rowgroup using the RowGroup name.
"The Hidden expression for the tablix 'X' 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. "
So, my Question(s)
Can you define a RowGroup name as the Scope argument in a First() function?
If not, What's the best way of achieving this without completely re-working my Dataset / RDL to accomplish this. (Using SSRS2008)
Why is it always just after posting a forum question, you figure it (or some workaround) out?
I'd still like some (better) answers if anyone sees this, but I've set a cell in the tablix to the value of the bit field that determines whether to show the column or not. I then changed my Column Visibility expression to check the cell value (using ReportItems!textboxname.Value) and it's working. as I scroll the payslips the columns visibility changes appropriately.

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.