use two different datasets in single report
Asked Answered
T

4

8

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..

Tawanda answered 30/7, 2013 at 18:27 Comment(0)
S
11

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.

  1. Recommended option : Re-write your query to create single dataset containing possible data you want to show in tabular fashion.

  2. 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.

Seaboard answered 30/7, 2013 at 18:40 Comment(0)
R
7

Specify data set name in third column Example:

=First(Fields!fieldname.Value,"DataSet1")
Rhodie answered 3/9, 2014 at 13:12 Comment(0)
M
3

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.
Mozarab answered 8/8, 2013 at 17:21 Comment(0)
K
-1

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);
Kg answered 16/11, 2016 at 5:32 Comment(1)
question has nothing to do with report viewer controlAbert

© 2022 - 2024 — McMap. All rights reserved.