Nested groups has been fixed for callback datasources (Thanks to Louis Coetzer)

This commit is contained in:
Arin Alexander
2017-06-12 13:36:30 +03:00
parent a726104669
commit 41d09a15ea
3 changed files with 18 additions and 7 deletions

View File

@@ -675,7 +675,7 @@ void ReportRender::renderGroupHeader(BandDesignIntf *parentBand, IDataSource* da
IGroupBand* gb = dynamic_cast<IGroupBand*>(band);
if (gb&&gb->isNeedToClose(m_datasources)){
if (band->childBands().count()>0){
dataSource->prior();
bool didGoBack = dataSource->prior();
foreach (BandDesignIntf* subBand, band->childrenByType(BandDesignIntf::GroupHeader)) {
foreach(BandDesignIntf* footer, subBand->childrenByType(BandDesignIntf::GroupFooter)){
renderBand(footer, 0);
@@ -687,7 +687,12 @@ void ReportRender::renderGroupHeader(BandDesignIntf *parentBand, IDataSource* da
renderBand(footer, 0, StartNewPageAsNeeded);
}
dataSource->next();
if (didGoBack)
{
//New Method to undo prior... Alternatively pass in bool isUndoPrior into next()
dataSource->undoPrior();
//dataSource->next(); //Also emit changePos, which it should not at this point
}
}
closeDataGroup(band);
// if (gb->isNeedToStartNewPage()){