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

Querying from two tables

3 Answers 60 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Edd
Top achievements
Rank 1
Edd asked on 18 Nov 2013, 03:16 PM
Please it it possible to have two sqldatasources in one report.
Thank you

3 Answers, 1 is accepted

Sort by
0
David
Top achievements
Rank 1
Iron
Veteran
Iron
answered on 18 Nov 2013, 07:34 PM
I believe the "official" answer is you cannot have more than one data source per report. 

Of course that does not mean you cannot.  Construct a report with two sub reports.  Sub report #1 has the report having data from data source #1, Sub report #2 has a report with data from data source #2.  This means you do not violate the rules.

I have dozens of reports which use that methodology with success.

It is all a matter of perspective.
0
Edd
Top achievements
Rank 1
answered on 19 Nov 2013, 02:45 PM
In that case how can i get the value of a subreport and sum it with that of a value from the master report. thank you
0
IvanY
Telerik team
answered on 22 Nov 2013, 02:06 PM
Hello Edd,

You can have one or many data sources in your report. For example if your report has 4 tables and 3 graph items you could have 7 data sources in a single report. So there is no restriction regarding that. Please also check the examples that get installed along with the product and are located in Start -> Telerik -> Reporting Q2 2013 -> Visual Studio 2010 Examples.

Regarding the calculations - a good approach would be to make the calculations outside of the report and then just pass the values to the report. Another approach would be to have a parameter for each data source (a hidden parameter). Then in each parameter calculate the exact same thing as you do in each table (or subreport). Then in a textbox in the report you can simply sum all parameters.

Regards,
IvanY
Telerik

New HTML5/JS REPORT VIEWER with MOBILE AND TOUCH SUPPORT available in Telerik Reporting Q3 2013! Get the new Reporting version from your account or download a trial.

Tags
General Discussions
Asked by
Edd
Top achievements
Rank 1
Answers by
David
Top achievements
Rank 1
Iron
Veteran
Iron
Edd
Top achievements
Rank 1
IvanY
Telerik team
Share this question
or