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

Duplicate pages when binding to a list of custom objects

1 Answer 169 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mark Oliver
Top achievements
Rank 1
Mark Oliver asked on 28 Jun 2010, 04:39 AM
Hi there,

I have a report in my project that binds to a list of custom objects. Each of these objects has several properties which I am displaying in a row in the details section. The report looks fine, the row in the details section is correctly rendering 10 times (the number of objects in the list) on each page. The problem that I am encountering is that the report is also rendering 10 duplicate pages, one for each object. These are carbon copies of each other and have identical data etc.

I am setting the data source as per the following line of code:

objSummary.DataSource = Me.StockSummary

This is in a "GenerateReport()" sub that I call after creating the report object.

StockSummary is a populated list of a custom class (ClosingSummary). This class contains several properties which I am displaying in textboxes in the details section using "=Field.PropertyName"


Any help would be greatly appreciated,

Mark.




1 Answer, 1 is accepted

Sort by
0
Accepted
Steve
Telerik team
answered on 28 Jun 2010, 09:38 AM
Hi Mark,

Such result can be observed whenever you have used nested data regions i.e. a Table or SubReport item inside the detail section of the report. The detail section is repeated once for each record from the data source, and if you have Table/SubReport, they would be repeated this much. You should either bind either one of the data items (report or Table) or filter the records of the Table/SubReport items as per a field from the main report's datasource - it all depends on what you're aiming for.


Kind regards,
Steve
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Mark Oliver
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or