How to merge multible datasets in Microsoft SQL server reports builder - sql-server

I want to Create report to show me main dataset and subs under it ..
EX:
Employee table as main table contains his informations.
under each employee (each row) more than sub table to show his vacations, benifits.
I have data sets called (EmployeeDS,EmployeeVacationDS,EmployeeBenifitsDS,EmployeeCommentsDS) with forign key and last 3 datasets.
I hope I could explain it well with out image.
how can i do this ?

Related

Crystal Reports: passing calculated data through parameter to subreport

This is my first time working with subreports, but I have about 6 months of Crystal experience.
I am constructing a daily report for sales managers, where they can get a summary of each of their salespeople's activity (open orders, quotes, etc.). This report already exists as an individual sales report, where they get more details on their activity, so I'm using a summarized copy of that report as a subreport for the new Manager version.
My issue is
generating the list of salespeople under the sales manager, eg:
"if parameter = managercode then select salesperson where salesperson_managercode = managercode"
Getting stuck on this logic, can't seem to crack it.
passing the above list through the subreport, one at a time. Essentially a loop. From there I want to total everything to provide a Team Total at the bottom.
Any help is appreciated!!
You shouldn't need to worry about the looping structure. The report will take care of that for you. If you have a dataset where each row represents 1 manager, then placing your subreport within a section that repeats for each record in the dataset will allow the subreport to effectively loop through each record in the dataset.
The employees who are supervised by each manager can then be selected by using the "link" between the main report and the subreport. A "link" is defined in your subreport's setup by declaring a field from the database in the main report and a field within the database of the subreport. The field in the subreport should be a Foreign Key that corresponds to the field in the main report. Following the example of managers and employees, your main report would have a dataset the represents Managers. This dataset should have a primary key such as Manager_ID. Then your subreport that represents the Employees would have a dataset that contains columns such as Employee_ID as a Primary Key that is unique for each employee, as well as a foreign key such as Manager_ID that indicates which manager is responsible for the given employee. When linking the subreport and main report you will want to use Manager_ID as the "link" between them.
I hope this helps, or at least helps you get started!

SSRS - Issue with blank table

I'm trying to build a report that will returns both a customers information and the services they received. So far how I've broken this report is for the customer information I added a "list" and then since I needed the headers on the left side (text boxes with text) and info on the right (text boxes converted to variables). I drug over each variable from my dataset1 individually.
The second box is a 2nd list with a table inside of it representing only the services performed for the customer from dataset2.
The problem I am having is if the customer exists it populates the 1st list but if they do not have any services then list 2 disappears and the only thing that exists is the customer information list.
Is there a way to still show the 2nd list with an empty table if no services exist for a current customer??
EDITED:
1st Pic - shows the 2 tables I've added to my report. Diagnosis table is in List1 and the Treatment Plan table is in List2.
2nd Pic - shows the refreshed report where data exists for the Diagnosis table but the table/list containing the Treatment Plan... is now missing since there is no data available to populate this table.

MS Access - column choice based on the other column

I'm creating a simple database which will allow users to manage cars and contains data like registration number, brand, model, dates of upcoming maintenance controls... (in my country marka = brand)
I have created relations like this:
In t_podwozie I have created link & relation columns fk_marka, fk_model. I need fk_model choices to be limited by my choice in fk_marka.
I have tried to use a query connecting brands and model (INNER JOIN) but then I can save only one column in t_podwozie. Any advice?
Both link & relation columns consist of id column and name column (id's are hidden)

Render multiple pages in SSRS report into single page

I have a SSRS report to show values from a stored procedure in SQL Server Business Intelligence Studio. The stored procedure will return 120 rows, each row will be displayed as a table format in my report.
So now I have 120 pages, each page having one table equivalent to a row in the stored procedure. I want 4 tables on every single page, so that there should be 30 pages in the SSRS report, with each page having 4 tables that is 4 rows from the stored procedure.
I have added grouping and page breaks but it did not help. Can you please help me.?
Currently I have
Actually I want like this
Add this to the code of your report. Inside <Page></Page>.
It should be like this:
<Page>
<InteractiveHeight>0in</InteractiveHeight>
<InteractiveWidth>8.5in</InteractiveWidth>
</Page>
Change the InteractiveHeight value. You can notice that I just put 0in on it. That means, there will be no height limit. The report will just always show in just 1 page. Measure/Estimate the report's Height by inches to show only 4 tables per page of your report.
In case you're not familiar how to view the code of you report, Just follow the below steps.
1. Go to Solution Explorer.
2. Right Click the report.
3. Click View Code
you can change your proc to add a grouping column, and a table column, something like this
*group, table,row columns*
group1, table1,row1
group1, table2,row2
group1, table3,row3
group1, table4,row4
group2, table1,row5
group2, table2,row6
group2, table3,row7
group2, table4,row8
..
you will need some manipulating the sql to achieve this, but doable.
Then in your ssrs report, put a list object, the list will group on the group column defined above. Add 4 tables in 2 x 2 format into a rectangle object (rectangle is to keep the tables together), each table will have a filter (in properties) (table 1: table = table, table 2: table = table etc), then add the rectangle into the list. In the group properties of the list, check break between groups. Now your page will be based on the groups you defined. And each table in the same group(page) will only show data based on the filter.

Filtering Subreport data on a Winforms report

I am using Winforms Reporting Services (RDLC) to generate a report that has a subreport.
My problem is the subreport isn't being filtered by the parent ID.
A simple example of the data model might be a Department which contains Employees.
In the report I want to show all Departments and have a subreport to show the Employees that belong to that Department.
I created a Dataset with two DataTables (Department and Employee). I created a relationship between the two Tables using the DepartmentId column.
In the Form I Fill each table using the appropriate Fill commands. I first fill the Department table then fill the Employee table, i.e. Select * From Deparment and Select * from Employee.
Now for the actual RDLC's:
The Department rdlc uses the Deparment datasource and shows information about the department. I dropped a subreport control on this rdlc and set up the properties. I am passing a ReportProperty to the subreport which is the Field!DepartmentId.
In the Employee rdlc I added the Employee datasource and created a filter on Property!DepartmentId.
When I run the report I can cycle through each Department but the subreport does not show. If I remove the Filter from the Employee datasource the subreport shows but displays all of the employees.
In the Form itself I am handling the SubProcessing evert and adding the Employee datasource to the report.
Any ideas on how to link the Subreport data to the parent?
Pass in the ID from the parent to the sub-report as a parameter and then filter the table in the sub-report based on that parameter value.
MSDN - Configuring Subreports and Drillthrough reports

Resources