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

SubReport inside SubReport inside Report

1 Answer 31 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Pierre
Top achievements
Rank 1
Pierre asked on 17 Mar 2017, 10:10 AM

Hi,

I have the following:
Report (report_product)
SubReport 1 (SubReportOperation)
SubReport in SubReportOperation (SubReportPreparation)

Report_product
 ...
 Header and general info for report product
 ...
 SubReportOperation line 1
 SubReportOperation line 2
         SubReportPreparation line 1
         SubReportPreparation line 2
         SubReportPreparation line n
 SubReportOperation line 3
 SubReportOperation line 4
         SubReportPreparation line 1
         SubReportPreparation line 2
 SubReportOperation line 5
 SubReportOperation line n
The datasource for the SubReportPreparation depend on the ID of SubReportOperation DataObject)
I try this in the SubReportOperation report, DataBinding of the SubReportPreparation but that doesn't work
        private void SubReportPrepa_ItemDataBinding(object sender, EventArgs e)
        {
            Telerik.Reporting.Processing.SubReport report = (Telerik.Reporting.Processing.SubReport)sender;
            SubReportPreparation subReport_Preparation = new SubReportPreparation(_connectionStringName);
            Telerik.Reporting.InstanceReportSource irs_subReport_Preparation = new Telerik.Reporting.InstanceReportSource();
            irs_subReport_Preparation.Parameters.Add(new Telerik.Reporting.Parameter("OF_OPERATION_ID", report.DataObject["ID"]));
            irs_subReport_Preparation.ReportDocument = subReport_Preparation;
            this.subReport_preparation.ReportSource = irs_subReport_Preparation;
        }

How must i do PLEASE ?

THANKS

 

1 Answer, 1 is accepted

Sort by
0
Katia
Telerik team
answered on 21 Mar 2017, 12:51 PM
Hello Pierre,

As of R3 2016 release, changes applied to the item definition inside report events will not be applied - Changes on items in report events are not applied.
In the provided code, you access the definition of SubReport item:
this.subReport_preparation.ReportSource = irs_subReport_Preparation;
This code will not take effect as inside events you can only work with processing items.

Instead of using events to set the ReportSource of Subreport item, you can set it in the Report Desiger where passing parameters can be achieved using Edit Parameters button in Edit Report Source dialog - check SubReport (Passing Parameters to a SubReport) for more details.

Another approach is to use a user function that returns a ReportSource object and use it when adding a binding for SubReport item's ReportSource property.

I hope this will help.


Regards,
Katia
Telerik by Progress
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
Tags
General Discussions
Asked by
Pierre
Top achievements
Rank 1
Answers by
Katia
Telerik team
Share this question
or