How to repeat multiple tables in report For multiple values? - reporting-services

I have one report in which I have table like below,
Now as for change I need to add the second table for each customer and the new report should look like as below,
So basically, I want to repeat two tables for each customer there will be multiple customers or single customer. I tried following this answer but with no luck. (The table should always visible so can not go with the drill down report.)
Any help would be great. My reporting server is 2008 r2.In case of the problem or confusion feel free to comment.

Similar to Jacob's answer, but make a subreport that handles all the tables and datasets for one single customer.
Then use a list object that is populated by a dataset of all the customers you want to display, and put the subreport in the list object, passing the customerId to the subreport.

You need to place it(the table) in a list object. And configure the grouping of the list and filtering of your table.

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 Subreport or other solution

I am working on a report that will show scheduling data. This report will need to show data for any job that has a promised date between a specified date range.
The issue I am running into is how to best display this data, I have a dataset built that has header info (Job #, Description, Due Date etc.) which returns a single line row for each job.
There are then several detail records for each job (Line item descriptions / details, Work center descriptions and details). Each of these could return several rows.
My question is how to group this detail data with each header record. Hoping to have something like this with one record block per job:
-- Header Dataset Job Number , Job Desc, Date Ship By ... etc.
--Line item description dataset
--Work Center dataset
Next record.....
Thanks in advance for any help.
Brian
If each of the records in your dataset have a field that they can be grouped by then this is actually pretty easy. You need to use the grouping feature of the table in SSRS. It's easiest to create a view that contains all the rows (both headers and details) logically and pass it to SSRS as one dataset.
Here is a recent walkthrough from Microsoft. You can change the version number to match your specific version since you didn't specify in the question. Group header fields can be formatted distintly to make them standout etc.
http://technet.microsoft.com/en-us/library/dd255263.aspx
If a field that you can group by isn't contained in the dataset in the report, i.e. it's a foreign relationship or something and you can't put them into a single view then you'll need to look into sub-reports. Based on the information provided however a simple row or column group should work just fine.

How do I reference group data in a textbox on Reporting Services?

I'm creating a report with a table that is grouped by a department code. There's a page break at the end, so each page only has data for that department code. Outside of the table, I want to have a textbox that contains the department code for that page/group.
I've tried using a hidden column with the data, but the textbox only ends up showing the last page's department code on every single page. I imagine I'm missing a simple solution, but I can't figure it out and Google seems to be failing me.
the problem is that you are just setting the report to break at certain points in the data instead of, say, rendering a sub-report multiple times by passing a parameter to it. the data only exists inside the scope of the table.
what you could do is set up a sub report that accepts a department parameter and generates data for one department. in the sub report you could then add the header by referencing the parameter that's being passed. then in your main report you create a table with a dataset of unique departments. group by the department in the table, and drag the sub report into the table and set the parameter. if you do it right you should get the same effect, but with the department header.
if you need more clarification, feel free to ask.
Could you maybe add a column to the table that just looks like its outside of the rest of the table to the user, but is actually in the table. Maybe pad a couple of blank cols then show the data.
If you are handling the page break in the logic of the table you will probably have to keep the data in the table.