Repeat Alternating Tables per each available parameter value - reporting-services

I have 2 datasets for two different tables/reports. A third dataset contains available values for my parameter. Both tables use this same parameter. I want both of my tables to be repeated per available value in the parameter. I want the tables to alternate, instead of just having one table repeated x times followed by the next table being repeated the same number of times. Is there a way to do this?SSRS report snippet
I tried putting the tablix in a list and grouping the list on the parameter values. This made the tablix repeat for each parameter value, but I can't add the second table to the list since it has a different dataset. The datasets are so different that it's hard to combine them into one.

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.

I need to join four dataset results into one tablix

I have four datasets that get information for four different things (a unique set of fields for each one), but that can be joined using a field they share. I need to get them all into a tablix that will have four rows, one for each dataset per the linking field. How do I do that?
Currently I can only put in values from one dataset.
Often the best idea would be to create a query that joins the datasets in the sql. If that is not possible, you can look into using the Lookup function to find info from other datasets in your report. The related Lookupset function is able to retrieve sets of information and may be useful as well.

use two different datasets in single report

I have two different-2 datasets with different fileds which are getting populated through two stored procedures with same input parameters.each datsets have different colums and no of columns around 180,my concern is how will i use these two different datsets in single report with two differents fields(two differnt tables).for one dataset i have used report wizard,but not able to figure out for the second dataset.Please suggest for the same..
You can use two different datasets in different reports regions on one Report. For example, If you have two datasets, lets say DS1 showing EmployeeDetail and DS2 showing SalesInfo. You can use them separately in two tables one showing Employees Details and other showing Sales Info. If you plan to merge this data and use it in one table, These are option.
Recommended option : Re-write your query to create single dataset containing possible data you want to show in tabular fashion.
Would work but would be lot slower : Use DS1 in a table in Main Report where each row contains Epmloyee Detail, Wihtin that Row call a Sub-Report passing EmployeeDetail's key which is related to a column in SalesInfo. Create sub-report showing SaledInfo data, call this report in main report passing key value from DS1 to this sub-report.
Specify data set name in third column
Example:
=First(Fields!fieldname.Value,"DataSet1")
Using two different or multiple datasets in a report is not a problem at all, as long as they do not belong to the same data region (charts, tables, etc.)
In addition to Ron's answer, if you are looking to get data from different datasets in one data region, you could also use Lookup or LookupSet in the field expressions.
Additionally, you may also create one dataset and filter out some data from it in data regions. For example, if you have one big dataset of all employees, and you would like to display all employees that joined in the year 2012 in a table, you could filter out the dataset using Filter properties of table.
You can simply add multiple table in your report , and change datasetName from tablix properties for each of your table .
you will also need binding source to fill that dataset .
this.invoiceTableAdapter.Fill(this.ARQutationDataSet.invoice);

ssrs two datasets used in a list for two matrixs

In SSRS 2005 I have a report with two matrix with two data sets. The report was running fine based when ran on different parameters.
Now I have been asked to modify the report and place another option in the parameter for "All" this will retrieve the results of all parameters and once extracted to Excel it will create different sheets in Excel for based on each parameters results.
For the above purpose I am using a list so each parameter result would be on one page but the problem is when I add the two matrix in the list the second matrix only retrieve values of first data set as the column names are similar. I can provide the second matrix value of second dataset with First(Fields!Site.Value,"Second DataSet") but it obviously picks up only the first value from the second dataset.
I was wondering if there is anyway I can use two datasets in a list and the second dataset picks up all the values and not just only the first value.
Or is there a better way to achieve the above in SSRS.
1) remove First from this expression : First(Fields!Site.Value,"Second DataSet")
2) your expression should be only =Fields!Site.Value. No need to provide dataset name"Second DataSet".

SSRS Grouping multiple tables based on Multi Value parameter

I have a report containing seven tables, each table returning a different set of values for a list of id's selected in a parameter list. I have the tables enclosed in a rectangle so that they print together.
Now I would like to group the results based on the id passed in from the multi-select parameter. So if I have a list of four ids in my parameter list the report would displaying my rectangle of seven tables four times, one for each id.
What would be the best way to do this?
Should I take my rectangle of seven tables and enclose it in another table grouped on the id? Or place it in a list item?
Any suggestions?
You can add grouping on the rectangle on Parameters!<ParameterName>.Value which is an array of values.
Then, per table you need to define this group as the parent and SSRS should then pass the grouping ID to the tables in each rectangle/id grouping.
Use a list control.
Try:
SORT FILENAME BY-EXP multivalueDict BREAK-ON MultivalueDict OtherValue1 OtherValue2 etc...