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

Passing the fields to subreport from main report sql data source

5 Answers 589 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Siva
Top achievements
Rank 1
Siva asked on 26 Jun 2012, 07:04 PM
i have main report with 1 sub report,  in main report have sqldatasource (with selected statement) it returns some fields, like product_id , product_name , i want send the Prodcut_id to subreport sqldatasource (selected statement).

Thanks in advance

5 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 27 Jun 2012, 07:00 AM
Hi Siva,

Check out the respective How-To topic from our documentation that covers this scenario: How-To: Creating Master-Detail Reports Using SubReports. In the SqlDataSource of the subreport, you set the Value of the datasource parameter to equal the report parameter value passed from the main report.

Kind regards,
Steve
the Telerik team

FREE WEBINAR ON THE NEW REPORT DESIGNER! Join us on Friday, June 29 at 10:00 AM PST for a comprehensive demo of the official version of the standalone Report Designer and find out how easy it is to empower your users with creating, editing and sharing ad-hoc reports. You may even win a free Telerik Ultimate Collection license! Register today >>

0
Siva
Top achievements
Rank 1
answered on 27 Jun 2012, 03:06 PM
Thank u Steve, i got the solution for that,
i got 1 more question i have 1 main report with 2 sub reports, in my main report i don't have any data sources, when i assigned the parameter values to main report from UI, but when i debug the sub report it took the design time parameter values, didn't take the current values, so how to pass the current values to subreports 
0
Steve
Telerik team
answered on 27 Jun 2012, 03:16 PM
Hi Siva,

If you have set the master-detail relation like in the help article, it would use the new report parameter value (refer to Invoice demo report). If it uses the default value, it means that it works with the definition object instead of the processing, which can go wrong if you do it with code. See Using Report Parameters programmatically help article for a code snippet of proper usage.

All the best,
Steve
the Telerik team

FREE WEBINAR ON THE NEW REPORT DESIGNER! Join us on Friday, June 29 at 10:00 AM PST for a comprehensive demo of the official version of the standalone Report Designer and find out how easy it is to empower your users with creating, editing and sharing ad-hoc reports. You may even win a free Telerik Ultimate Collection license! Register today >>

0
Siva
Top achievements
Rank 1
answered on 27 Jun 2012, 05:31 PM
i understood report parameters logically, but in that sub report i have 2 group header section and 1 detail section each section has different SQL data sources how it assign all of them with in  need data source event?
0
Steve
Telerik team
answered on 02 Jul 2012, 12:36 PM
Hello Siva,

A report can be bound to a single data source only, so you cannot have group section and detail section with different data source, unless you use other Data Items inside those sections. The explanation from my previous post was not pointing to start using NeedDataSource, rather explaining that you might get the definition/initial value of the report parameter only if you're doing this programmatically. If you were using our Data Source Components rather than binding programmatically, this should not happen (refer to Invoice report as example).

Kind regards,
Steve
the Telerik team

BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

Tags
General Discussions
Asked by
Siva
Top achievements
Rank 1
Answers by
Steve
Telerik team
Siva
Top achievements
Rank 1
Share this question
or