Dont's show rows in SSRS - reporting-services

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.

Related

SSRS - My row filter code is correct but is not being applied

I am trying to create a row filter on a table in SSRS.
My formula looks as follows:
I have the exact same formula pasted into the "Show" column below:
It doesn't matter what I try, "IsNothing() = true", "Len=0", "CDBl(number + 10) = 0"; "IsNothing(TextBox20) = true"
The entire dataset comes back. I only want to show items that are in my one dataset, but do not exist in another.
I've tried creating a group with my results set (as per a stack overflow solution), but nothing seems to work. Either the entire dataset is returned or none of it. I only want the "Show=true" rows to be returned. What am I doing wrong?

SSRS - Get the ReportItem!____.Name of the current item (textbox or column)

I have a big report with 100+ columns named 'Column001', 'Column002' etc etc.
These columns hide depending on whether there is any data or not, and I'd like to have the last column have a right side border.
So I could do something like (in pseudocode)
= IIF(COUNT(ReportFields!Columns.Values) = CINT(RIGHT([CurrentReportItem].Name,3)), RIGHT_BORDER, NO_BORDER)
Is there any way to get the current item (ReportItem!) so that I can get it's name?
If you have control over the query then you can modify it to return the number of visible rows as a non-displayed new field in the result set and then compare that value at each column to decide if the border should be displayed.
If you do not have control over the query then I think you are limited to a painful series of nested IIf() statements.

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.

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

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.