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

Problem with setting source to nested report

1 Answer 74 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Michele
Top achievements
Rank 2
Michele asked on 18 Dec 2013, 11:19 AM
Hello,
I've the following scenario, I've got a collection that's bound to a Report, the report has 4 groups and in the last GroupHeader I've a subreport

I need to group on

ID_FIELD1
ID_FIELD2
ID_FIELD3
ID_FIELD4

I've created the grouping and it seems to work...I've got problem with setting the report source (it's null in the subreport)

I've checked at NeedDataSource of subreport and

private void subReport1_NeedDataSource_1(object sender, EventArgs e)
     {
         var sub = sender as Telerik.Reporting.Processing.SubReport;
 
         var datasource = sub.Report.DataSource; //here data are splitted correctly
        
     }
 in the subreport I always have null

can you please provide me how to fetch the data in the inner source?
Thanks


1 Answer, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 21 Dec 2013, 12:58 PM
Hello Paolo,

Note that it is highly recommended to avoid events when designing reports. The reporting engine provides powerful declarative means to achieve the same functionality. For example instead of using events to accomplish your goals you can take advantage of Expressions, User Functions and Bindings.

Given the provided information for your report structure, you can set the subreport data source using a binding like the following:

DataSource = ReportItem.DataObject

More information on the topic can be found in the How to use ReportItem.DataObject property in expressions help article.

Regards,
Nasko
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
Michele
Top achievements
Rank 2
Answers by
Nasko
Telerik team
Share this question
or