I have a report like that
groupheader1
groupheader2
detail
groupfooter2
groupfooter1
for some groupheader2, i need a page break page.
I write some code, like that :
groupheader1
groupheader2
detail
groupfooter2
groupfooter1
for some groupheader2, i need a page break page.
I write some code, like that :
private void groupHeader2_ItemDataBinding(object sender, EventArgs e) |
{ |
Telerik.Reporting.Processing.GroupSection headerAgent = (Telerik.Reporting.Processing.GroupSection)sender; |
LinqEntityBaseLoan.ComAPayer com = headerAgent.DataObject.RawData as LinqEntityBaseLoan.ComAPayer; |
headerAgent.Visible = com.Agent_ID != com.SuperAgent_ID; |
if (headerAgent.Visible) |
this.groupHeaderAgent.PageBreak = PageBreak.Before; |
else |
this.groupHeaderAgent.PageBreak = PageBreak.None; |
} |
but the result is that in the next printed header, the page break will occur.
I try to change to headerAgent.PageBreak = PageBreak.Before but PageBreak is readonly. It seems that the ..Engine.ReportSection is created before Report.ReportSection (it is normal) and can not be changed (but visible can be !).
After a long search, i created a fake group :
groupheader1
groupheader2fake
groupheader2
detail
groupfooter2
groupfooter2fake
groupfooter1
And write the event groupHeader2fake_ItemDataBinding.
Is it normal to proceed like this ? A settable Break Page or an event before the creation of Engine.ReportSection can be usefull !