SSRS 2012 - Hide table row containing a subreport with no data - reporting-services

I have a table with a details grouping containing two rows. The top row is several cells across with details on the data, and the bottom row is all columns merged to one cell, and that cell contains a subreport. This subreport has one parameter, which is the value of a cell in the top row. What I need is, when the subreport does not have any data to display for a particular value, for that row to not display at all. Right now it displays as a blank row between its top detail row and the next detail row. I can get it to display a "No Rows" message, but I don't want that, I just want it to not take up any space, ie the detail row would just be followed by the next detail row. I've found several similar answers like this: How to supress empty subreports in SSRS 2008, but as I said I need to NOT have a No Rows message. Thanks in advance

I 'think' the only way you can do this is to query the data from the main report and if no rows are returned, hide the row. If the subreport is a simple query then this should be OK but if it's a long running query then this will effectively double the execution time.
You have not given any clue as to the content of the subreport but if it was say, invoice lines for the invoice shown in the main report row then you might be able to modify your main dataset to include a count of records that would appear in the subreport and use that value to control the row visibility.
If this makes not sense, edit your question and post a screenshot of what you are trying to achieve and/or post a sample of the data that you are getting from both the main report and your subreport.

One simple way that worked for me was as follows:
Select the row that will contain the subreport. Set the CanGrow and CanShrink properties to true. Insert the subreport into the row. Under SubReport Properties > Visibility > Show or hideā€¦ and add the following expression:
=IIF(RowNumber(Nothing)>0,False,True)
Then select the row again and use the handles to make the row as small as possible or as small as you like. When you run the main report the subreport will appear if it return records, otherwise the row will be blank and the height will be what you set above with the handles.

Related

In SSRS is there a way to use newspaper columns and still have a new page per group?

My dataset is grouped by customer then itemtype and then the details are the itemcodes and descriptions.
I am using the Newspaper column setting so that the list of items continues on to the right side of the page instead of moving on to the next page.
My problem is that I want to start a brand new page for each customer. Since SSRS treats each column as a page break, I get a page where one column belongs to one customer and the next column belongs to another.
I have tried the page break setting on the different group and the tablix properties to try and force a double page break to happen with no luck. I have also tried to drop a rectangle into the table and use the page break setting there, also no luck.
Any help would be appreciated.
Thanks,
Jessica
I've not used the multi-column layout so I can;t directly comment on that but what you could potentially do is use a subreport.
If the following does not help, post a sample of your data and your current report design and I'll post a full answer.
In short, create a report that only handles a single customer, so it will need to have a parameter passed into it that identifies each customer such as a CustomerID.
Once you have the report working with a single customer, create another report.
On this report create a dataset that just contains a list of customers you want to report on (so a list of CustomerID's for example).
Add a table to the report and remove all but a single "cell". Expand this cell to be roughly the width of your subreport (it does not have to be exact).
Set the dataset property of this table to the dataset containing your list of customers.
In the remaning cell, right-click then Insert >> Subreport. This will fill the cell with a subreport control. Right-click the subreport control and set the subreport to be the sub-report we created earlier that handles 1 customer. In the parameters, set the CustomerID parameter to the field from your customer list dataset.
Finally, right-click the 'details' rowgroup and set page breaks to 'between each instance'.
This will generate one subreport per customer and put a page break between each.

SSRS - action dynamic between two tables

I have a report (SSRS) with two tables and two data sets, first table(tablix) to load grouped data and second table(tablix) to load detailed data.
I would like to click dynamically, when I click on the first table of a record, it shows only the details of that record selected in the second table, is that possible?
If you mean you want to show two tables on screen at once and refresh only the second one when an item is clicked in the first table then no, you can't do this natively in SSRS.
There are two ways of doing something similar.
Combine both sets of data and have a single table with grouped rows. Hide the details until the group is expanded by setting the row visibility of the detail row to be based on a textbox that belongs in the parent group.
Use two report, have an action ("Go to Report") on the first report that launches the detail report and passes in the parameter in to filter only on the selected item.
None of these will give you exactly what you want, hopefully one of them might be an acceptable alternative.

Can you link multiple tablixes on a key field in a single SSRS report?

I am creating a report in SSRS to show evaluation scores. It has three sections, and I need to link them all together on the PreceptorID field (2108 in this case). The top two sections are from the same query. I am filtering the results in each one to separate the counts because they have different column names. The third section is a subreport showing comments from evaluators. It also has the PreceptorID field in the data but is not displaying it. It has two parameters that should be populated by the main report query, but that does not appear to be happening. The report is returning all comments instead of only the ones with the matching PreceptorID.
This first image is from Crystal Reports showing how the finished product should look.
This is what I am getting from SSRS. It is showing counts for multiple people at the top. The counts in the middle are actually correct. They are all for the one person. The next person's counts are on the next page. The comments at the bottom are also not filtering on the one PreceptorID.
This image showing the subreport parameter that should be linking it back to the main query.
How can I tell all three sections to only return data for the same person on one page, and another person on the next page?
I would redesign the report structure slightly. This is only my personal preference, there are several ways to achieve this but I find this way easier to manage and maintain.
You'll need two subreports and a master report.
You already have the 2nd subreport so no extra work required there.
I would take you current report, strip out the link to the current subreport and change it so it only processes a single person (just like your existing sub report).
So SubReport1 will have the two tables from your current main report only. It will only accept a single person as a parameter (or pair of parameters in your case)
SubReport2 will be your current subreport. Again it only accepts a single person.
Next create a new report. This will be the master report.
Add a dataset that contains just enough info for list of people you want to report over. So the dataset query might be as simple as
SELECT PreceptorID, ClerkshipID FROM myTable ORDER BY PreceptorID
Add a table to this report and set it's dataset property to the dataset you just created.
Change the default (details) row group to group and order by whatever makes each record unique (maybe both the two columns listed above, may only one will be required, only you will know this).
Right-Click on the row header to the left of your table and do "Insert Row => Inside Group Below".
Remove all but one column
You should now have a table with 2 rows per group.
Right click the top cell in the group and do "Insert => Subreport", go to the subreport properties and point this to SubReport1 (or whatever you called it) and set the parameters has you have done previously.
Repeat this for second row, this time pointing to your second subreport.
In the row group properties, set page breaks to "Between each instance"
That should be it. This was done from memory so might not be 100% but based on the info in your question you should be able to work it out from here.
Things to check if this is not working
Open each subreport and test it by passing in parameters manually. Each subreport should only be returning data for a single person.
The master report should have a dataset that returns each person once i.e. if there are 10 people in total this dataset should only contain 10 rows.
The table in the master report should contain only two rows
Both rows must be EITHER within the same row group, or, if you have no other row groups, they will both be in the detail row group.
The report design should look something like this if you have a row group by person
or like this if you only have detail rows.
Finally, make sure the parameters you pass to your subreports are the Field values from your master report's dataset, NOT your master reports parameters.

How can you repeat a tablix for each record returned from a query?

I am generating an SSRS report that is divided into sections, where each section is a separate tablix.
There is a section that should repeat for each instance of an entity. For example: if the report section involves 3 employees, the tablix of type employee should render 3 times, once for each employee.
Note that the number of employees for each report is variable.
Does anyone know of a feature in SSRS or a technique that can support this?
OK this is going to sound really weird but it works.
First you will need to insert a rectangle to the body of your report.
Drag and drop the entirety of the tablix into the rectangle. The tablix should not reside in the rectangle.
Second create a new Tablix and delete all but one column and one row (1X1) tablix.
Drag the rectangle containing the original tablix into the single cell of the new tablix.
You should now have a single cell tablix that contains a rectangle that contains your original tablix.
You can then select the single cell tablix that you created and enter the row group properties for the one row that you have. Add a group expression to group on, in your case, Entity.
You can then go even further and add page breaks between the tablix groups and this will separate the groups on separate pages.

Visual Studio Reporting Service Reports 2008

I am trying to generate a report that has 2 lines per record(or row) returned by the query. Simply the first row will hold certain fields but before it returns the next row/record..it generates a subrow as you may call it that holds an additional field. Is this possible? I have another idea of doing this and it would be to just add the extra field on the end of the row and wrap the row to fit on the page thus making it appear 2 lines per record/row returned.
I'm a total noob when it comes to using tablix and these reports so details would be great!
In the report designer, right-click on the detail row header (the gray area, should have 3 horizontal lines), and select Insert Row -> Inside Group (either above or below, depending on where you want the row).
This will add a new row to the current group, with the current group being your detail rows. You can then add fields and text to the second row, and both will show up for each dataset record when the report is run.