This is a migrated thread and some comments may be shown as answers.

Binding Multiple tables to Report

18 Answers 1576 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
rajesh
Top achievements
Rank 2
rajesh asked on 25 Mar 2009, 06:27 AM
Hi,

I am using Telerik Reporting Controls in my application.I have a requirement where i will be having more than one table in a dataset.
i need to bind the data of first table to header and second table data to body and third table data to footer.

can it be possible to do like that.if it is then can you please let me know regarding this.

Thanks & Regards,

Rajesh

18 Answers, 1 is accepted

Sort by
0
Ivan
Telerik team
answered on 25 Mar 2009, 10:12 AM
Hello rajesh,

Telerik Reporting supports data-bound items in the report header/footer sections, group header/footer sections, and the detail section of a report. Data-bound items in the page header/footer sections are not supported, because it does not make sense. You can bind to more than one DataTable from a DataSet, of course.

You can visit our online documentation to familiarize yourself with the different report sections and the supported data binding. Check our online examples too, to see if any of them does something similar to what you are trying to accomplish.

We are sorry that we can not be more helpful, but since we do not know your specific requirements, this is the best we can tell you so far. If you have more specific questions regarding Telerik Reporting, please, do not hesitate to ask.

Greetings,

the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Dave
Top achievements
Rank 1
answered on 18 Sep 2009, 10:28 PM
I was just reading your posts to find out myself how to bind to more then one table in a Dataset and from your answer you stated that
"You can bind to more than one DataTable from a DataSet, of course."

You also linked to the data binding page and this is what that say's.  Unless I am missing something this is conflicting information.

"Telerik Reporting can be bound to a single table only. If your DataSource contains more tables, you can bind a separate report to it and take advantage of a subreport item or use table item to directly show data in main report."

Can you tell me what is correct?  I am not seeing how you can use fields from more then one table using the Report wizard and a dataset with more then one table.

Thanks,
Dave
0
Steve
Telerik team
answered on 22 Sep 2009, 12:25 PM
Hi Dave,

The explanation from my colleague's post only explains that this is possible, while the information in the documentation explains how to bind to more DataTables - via table/crosstab or subreport items. The wizard allows you to bind to a single DataTable and as explained - this is by design.

Regards,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Chris @ Intrinsic
Top achievements
Rank 1
answered on 31 Aug 2011, 06:27 PM
How would you access a particular table at design time?  I'm using WCF webservices.  I need the codebehind code, and what settings or extra code I would need in the actual report itself.  I have multiple tables, but I can't seem to figure out how to access a particular table at run time.  There must be some code to set the datasource to a particular table, but I've tried many things including:

report.DataSource = dataset.Tables[0];


My fields are coming up blank.  But, with a ONE table dataset, it works perfectly.



Thanks.
0
Hrisi
Telerik team
answered on 05 Sep 2011, 09:18 PM
Hello Chris,

If you prefer to design the report in Visual Studio designer with multiple tables you should use as many DataSource components as the number of the required tables. As I see from your explanation you are using  a DataSet but you do not show how the tables are filled with data and where and when this happen in your code.

We highly recommend you to open support ticket in order to send us a sample project demonstrating the issue.

Regards,
Hrisi
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Chris @ Intrinsic
Top achievements
Rank 1
answered on 08 Sep 2011, 03:33 AM
I figured it out, thanks.  It was the fact that I had to bind a datatable to each object, such as a table, etc.  I can't use two different datasources for the main report, only one, but the objects such as subreport, table have to be in the detail section, not in the main page area, etc.

0
Emix
Top achievements
Rank 1
answered on 04 Mar 2013, 08:56 AM

Hi Telerik Team

I want to make one stock report which contains data from 3 tables(sql) as given below. I want to show(select) all Products from 3 Tables, but products from “Purchase_Table” and  “Sale_Table”  should be between the user mentioned date (E.g.: 01-Jan-2013 to 01-March-2013, Date column(Filed) not mentioned in following Sales and Purchase Table but it is there). All Products from 3 tables should be grouped together according to their Product ID as given below(Stock Report).

1. Stock_Table

Product_ID

Product_Name

Opening_Stock

Current_Stock

Unit_Price

Total_Cost

101

Monitor

20

10

7200

72000

102

Keyboard

15

12

500

6000

103

Speaker

6

6

2000

12000

104

Printer

10

15

6000

90000

105

Scanner

5

10

4500

45000

106

Hard Disk

25

25

2500

62500

107

CD ROM

15

5

2100

10500

108

Mother Board

20

20

3500

70000

2. Purchase_Table

Product_ID

Product_Name

Purchase_Quantity

Unit_Price

Total_Cost

104

Printer

5

6000

30000

105

Scanner

15

4500

67500

107

CD ROM

5

2100

10500

3. Sale_Table

Product_ID

Product_Name

Sold_Quantity

Unit_Price

Total_Amount

Profit

101

Monitor

10

7500

75000

3000

102

Keyboard

3

2200

6600

600

105

Scanner

10

5000

50000

5000

107

CD ROM

15

2300

34500

3000

Stock Reort

Pro ID

Product Name

Opening

Purchase

Sale

Closing

QTY

Amount

QTY

Amount

QTY

Amount

QTY

Amount

101

Monitor

20

144000

10

75000

10

72000

102

Keybord

15

7500

3

6600

12

6000

103

Speaker

6

12000

6

12000

104

Printer

10

60000

5

30000

15

90000

105

Scanner

5

22500

15

67500

10

50000

10

45000

106

Hard Disk

25

62500

25

62500

107

CD ROM

15

31500

5

10500

15

34500

5

10500

108

Mother Board

20

70000

20

70000



Hope I will get solution soon, Thanks in advance...
0
Emix
Top achievements
Rank 1
answered on 04 Mar 2013, 11:13 AM
Please Reply....
0
Hadib Ahmabi
Top achievements
Rank 1
answered on 04 Mar 2013, 01:45 PM
Your scenario is actually pretty simple. You should JOIN the 3 tables, add WHERE clause for the dates and bind the data-source to a table. 
Most of the demos show how to work with parameters: http://demos.telerik.com/reporting/home.aspx , take a look at them and you should be able to do your report. 
0
Emix
Top achievements
Rank 1
answered on 06 Mar 2013, 07:51 AM
Hi Hadib Ahmabi,
God bless you,
I already used WHERE clause in my code snippette, but it only returns a product(s) which is stored on each 3 table). According to my table data mentioned above, when using WHERE clause it only returns 2 Products that is, 105, 107(Product ID is mentioned here). I want to Show detail of all products from Stock Table whether it is Available on other two tables or not. If it is available on other two table I need to merge these products with products from stock table according to user mentioned period (Date). Note that there is no date field in stock table. Just refer my table diagram given above.

0
Hadib Ahmabi
Top achievements
Rank 1
answered on 07 Mar 2013, 11:33 AM
That's because you are making INNER JOIN. Try with OUTER JOIN.
LEFT OUTER JOIN between Stock Table and the other table should be the right one. 
See http://en.wikipedia.org/wiki/Join_(SQL)
0
Umar
Top achievements
Rank 1
answered on 07 May 2014, 05:58 AM
You can bind to more than one DataTable from a DataSet, of course.

HOW?
0
VEERANNA
Top achievements
Rank 1
answered on 02 Jun 2017, 01:47 PM

Hi ,

     I am using Qt RPT tool for making report for my qt application...my problem is that i have two tables for making report in single page ....how to do please explain?

 

0
VEERANNA
Top achievements
Rank 1
answered on 02 Jun 2017, 01:47 PM
QTRPT supports sub report?
0
Wayne
Top achievements
Rank 1
answered on 23 Apr 2018, 04:11 AM
Missing something. Binding DataSets at runtime with many tables to Reporting. I see we are told to look at the demos but the demos have no sample code to work\learn from.
0
Katia
Telerik team
answered on 25 Apr 2018, 01:42 PM
Hello Wayne,

I will post below a reply from support ticket 1163463 that you opened for the same question:

"You can use a DataSet in Reporting with the help of the ObjectDataSource component. Sample code is available in How to: Bind to a DataSet. Since the report is rendered on the server in a client-server environment, keep in mind that the data has to be available on the server."

Regards,
Katia
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Rodrigo
Top achievements
Rank 1
Iron
answered on 21 Oct 2024, 07:37 PM
Hello, in 2024 is it still not possible to have more than one table when constructing the report?
0
Ivet
Telerik team
answered on 24 Oct 2024, 10:06 AM

Hi Rodrigo,

Thank you for reaching out.

Multiple tables in one data set are not supported. If the data set returns more than one table, only the first one will be used and displayed in the report designer.

You can use a DataSet in Reporting with the help of the ObjectDataSource component. Sample code is available in How to: Bind to a DataSet. Since the report is rendered on the server in a client-server environment, keep in mind that the data has to be available on the server.

Regards,
Ivet
Progress Telerik

Stay tuned by visiting our roadmap and feedback portal pages, enjoy a smooth take-off with our Getting Started resources, or visit the free self-paced technical training at https://learn.telerik.com/.
Tags
General Discussions
Asked by
rajesh
Top achievements
Rank 2
Answers by
Ivan
Telerik team
Dave
Top achievements
Rank 1
Steve
Telerik team
Chris @ Intrinsic
Top achievements
Rank 1
Hrisi
Telerik team
Emix
Top achievements
Rank 1
Hadib Ahmabi
Top achievements
Rank 1
Umar
Top achievements
Rank 1
VEERANNA
Top achievements
Rank 1
Wayne
Top achievements
Rank 1
Katia
Telerik team
Rodrigo
Top achievements
Rank 1
Iron
Ivet
Telerik team
Share this question
or