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

Subreport binding to report list item

2 Answers 306 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Costin Morariu
Top achievements
Rank 1
Costin Morariu asked on 11 Mar 2011, 02:59 PM

Hi,

I am trying to use subreports in the following way: a parent report contains A LIST and for every item in the list I would like to show a subreport.

This is parent report list load: 

 

public void ReportNeedDataSource(object sender, System.EventArgs e)
     
    DataSource = applicationReport;
    if ((applicationReport != null) && (applicationReport.Questionaire != null))
    {
        stepsList.DataSource = applicationReport.Questionaire.Steps;
    }
}

 

 

And in the subreport NeedDataSource event handler, I would like to get list item object since it is called for every stepList.DataSource item for filling some subreport fields.

What would be the best aproach to accomplish this?

Best regards,
Costin

2 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 16 Mar 2011, 04:47 PM
Hi Costin Morariu,

Our suggestion is to set the SubReport ReportSource.DataSource property with Binding to =ReportItem.DataObject. Just to note that you have to add a Panel item in the List cell and place the SubReport in it in order to access the correct data context.

Regards,
Peter
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Costin Morariu
Top achievements
Rank 1
answered on 25 Mar 2011, 11:28 PM
Hi Peter,

Thanks for your response. Sorry for not marking the solution success or failure, but I have not got the chance to finish the functionality where I encountered issue I've been asked.

Best regards,
Costin
Tags
General Discussions
Asked by
Costin Morariu
Top achievements
Rank 1
Answers by
Peter
Telerik team
Costin Morariu
Top achievements
Rank 1
Share this question
or