Is there a way to automatically add more tablixes? - reporting-services

Currently I'm creating a report with multiple Tablixes. Each Tablix shows the same information as the other Tablixes, filtered on a different group.
So, Group 1 has a Tablix, Group 2 has a Tablix, Group 3 has a Tablix, etc.
Now, the amount of groups will grow over time, with yet unknown names/identifiers.
What I'm trying to achieve is that when a new group gets added, a new Tablix is automatically added to the report as well.
Is this in any way possible? Or should I manually expand the report when such a group is added?
I was thinking about using a parameter that counts the amount of groups, then creates that many columns in a Tablix, and have the column automatically populate with another Tablix, but I believe it's not possible to have a Tablix with a fluid number of rows within another Tablix.
Cheers,
Casper

Related

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.

SSRS - Merging cells of specific columns

I am developing a complex report in SSRS which should like below
Screenshot 1
output returned by stored proc have multiple rows of one User ID and based on that columns "Successful Orders -- Online - Total Orders", "Successful Orders -- Online - Total Amount" & likewise Retail - Total, Other - Total columns cells should be merged based on respective User Id.
I have used tablix control and tried adding grouping over columns which needs to be merged but it is not working as expected. in order to group I am setting Sum of returned Value in cell but yet no luck.
Can you please provide me some pointers in order to achieve whats expected. please let me know if you need more information
output after adding nested tablix
ScreenShot 2
also, distorted output with inner tablix. borders are causing issues
ScreenShot 3
Try placing a tablix in the cells containing the multiple rows to display them. Basically, you need to switch your approach from "How do I merge these cells?" to "How do I split these cells." Set up your grouping at the level you want your totals and then in each of the columns where you want the details displayed, add a tablix to display the details. You'll need to play with the grouping a bit to get it display correctly.
More details:
The sample you provided above should be one group level row, not multiple detail level rows. Add your group to that Tablix and the summaries you want for your Total columns. Then Merge each of the "Mode" and "Count" column pairs and insert a Tablix into that merged cell with the same grouping as the row with the Totals, but with only the Details row displayed (don't add group header or footer and delete the blank row and summary column that automatically gets added). Now just set your field values for Mode and Count and adjust your column widths to match the headings.
Here's a REALLY simple report that displays a Plant and the employees associated with that plant. This is the top level where you Totals group would go. The next image is the "inner" part, where you would add in another Tablix with the same group(s), but only the details displayed.
This is super simple example and you may need to include additional levels of grouping to match your report, but the fundamentals still the same - an "outer" Tablix with an "inner" Tablix with matching group(s).
There's a lot you can do with this approach by manipulating the groups, hiding/displaying different groups or even hiding the details and displaying subtotals.

SSRS - Prevent pagebreak in the middle of a row group

I have an SSRS report that gets exported to PDF and then printed on to paper. The problem I am having is that I am getting page breaks in the middle of a group.
I have MetricGroup - MetricSubGroup and Details. Those are my Row Groups.
I have several different MetricGroups in the report.
I need to make it so that my report will not break in the middle of a MetricGroup.
So right now I get lets say 2 metric groups and half of the 3rd metric group on page 1. Page 2 contains the second half of the 3rd metric group and so on.
I need SSRS to push a metric group to the next page if the metric group does not fit entirely on the current page.
Is this possible to accomplish?
You need to use the KeepTogether option - but bear in mind this is a "best endeavours" process - for instance, you couldn't keep two thousand rows together on one page.
Another approach is to force page breaks and certain parts of the report.
To elaborate a little more on the previous answer, specifying KeepTogether = true for any given tablix member will try to keep all elements of that tablix member together.
So if you specify KeepTogether on your MetricGroup tablix member, SSRS will try to keep all elements of that tablix group together, and when it fails because the report spans multiple pages, it will page break where it likes, resulting in groups breaking up over pages.
If, however, you specify KeepTogether on your MetricSubGroup tablix member, SSRS will try to keep all of the subgroups within a MetricGroup together, which will result in the parent MetricGroup trying not to break on a page if that were possible.
I'm spelling this out explicitly because there's a common degenerate case here - a report without any groupings but with a complex details tablix that generates with multiple rows per data record. Trying to specify KeepTogether on the details tablix will try to keep all of the details together, introducing unexpected page breaks.
In this case you'll need to generate a details group as the immediate parent of the details tablix and group by whatever the report identity is. Then you can specify KeepTogether on the details tablix and it will keep together only the members for one single data record.

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.

Creating a group in SSRS

I have around 10 tables in an ssrs report and I need to add a group which includes them all. Is there a way to do that in ssrs?
I know how to create column and row groups within a single tablix, but I am not able to do the same for more than one tablix.
I created a table with a single cell, then inserted a rectangle in it and then copy/pasted all the tables in there. Then added a row group and it works!!