Display data in SSRS - reporting-services

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.

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:

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

Need help on SQL Server report

I have a question on SQL Server Reporting Services. In fact, I want to know about how to make a particular logic work.
I have a main report which has one sub-report inside it. The report takes an input parameter test_id and accordingly displays the data in tabular form.
When the test_id has a valid value that's matching, it displays the data.
But, when test_id doesn't have a valid value and hence it doesn't match, I get the empty table as below.
TESTNAME TESTDETAIL
Sub-report
TESTPARENTID PARENT DETAILS
I want to know how to display a message "No details found for the test_id" INSTEAD of displaying any empty tables. Only title and subtitle should display.
Objects like Tablix in SSRS have a property NoRowsMessage.
You can set this to display a message if there are zero rows.
Another option is to go into the tablix properties. Under Visibility, select Show or hide based on an expression. You can write an expression here to hide the entire tablix. Just change the name of the field to match yours:
=iif(Count(Field1)=0,True,False)

RDLC in VS 2010, how to display dynamic data in a table row

I have my report and data ready. The report is like i need to select a center name (Ex: Raleigh(0003) ) from the DDLB. and i will submit that. Now i will get the report for the Raleigh Center. Here, i need to see the text on the top of the report like "Weather Report for Raleigh (0003)" as a header. Whenever i select a different center, it should automatically display that particular center on the top of the report.
I tried to add the table, give the column (CENTER_ID) from the data set and in the expression, i gave like --> ="Weather details:"& Fields!CENTER_ID.Value &" - " & Fields!CENTER_NAME.Value. Here is the issue, it's either displaying all of the centers row by row or displaying a particular center name irrespective of the selection. Please help me out as it is very important.
Thanks.
When you select a center from the drop down - it is populating a parameter that you must then be using either to filter the query or to filter the table. Depending on how many rows the full query returns it might be better to do one or the other, e.g. if there are 1000's of rows you should filter the query, not the tablix. If it's not many rows then it's fine to filterthe tablix.
If the parameter is called #center then you could use this formula in your header:
="Weather details: "& Parameters!center.value
This assumes that your paramater is "text" type. If it is numeric or a date then you might have to convert it to a string first using CStr().
="Weather details: "& CStr(Parameters!center.value)
The reason it was showing you a "particular center name irrespective of the selection" is because you were telling it to put a dataset column (many rows) into a single cell. That will force it to always display the value in the first row, or if you are putting it in a details row in the tablix it will output every single value.
If you filter the query rather than the tablix, you could reliably use this:
="Weather details:"& First(Fields!CENTER_ID.Value,"datasetname") &" - " & First(Fields!CENTER_NAME.Value,"datasetname")
because the first() function will return a single value from the first row of the dataset.