0
0
mirror of https://github.com/fralx/LimeReport.git synced 2025-01-11 17:18:10 +03:00

Nested groups footers have been fixed

This commit is contained in:
Arin Alexander 2018-12-21 19:04:57 +03:00
parent a7e85671df
commit 37cbc134d1

View File

@ -717,22 +717,11 @@ void ReportRender::renderGroupHeader(BandDesignIntf *parentBand, IDataSource* da
if (gb&&gb->isNeedToClose(m_datasources)){
if (band->childBands().count()>0){
bool didGoBack = dataSource->prior();
foreach (BandDesignIntf* subBand, band->childrenByType(BandDesignIntf::GroupHeader)) {
foreach(BandDesignIntf* footer, subBand->childrenByType(BandDesignIntf::GroupFooter)){
renderBand(footer, 0, StartNewPageAsNeeded);
}
closeDataGroup(subBand);
}
foreach (BandDesignIntf* footer, band->childrenByType(BandDesignIntf::GroupFooter)) {
renderBand(footer, 0, StartNewPageAsNeeded);
}
renderGroupFooterByHeader(band);
if (didGoBack){
dataSource->next();
}
}
closeDataGroup(band);
}
if (gb && !gb->isStarted()){
@ -759,12 +748,14 @@ void ReportRender::renderGroupHeader(BandDesignIntf *parentBand, IDataSource* da
}
void ReportRender::renderGroupFooterByHeader(BandDesignIntf* groupHeader){
if (groupHeader->reprintOnEachPage()) m_reprintableBands.removeOne(groupHeader);
foreach (BandDesignIntf* header, groupHeader->childrenByType(BandDesignIntf::GroupHeader)){
renderGroupFooterByHeader(header);
}
foreach (BandDesignIntf* footer, groupHeader->childrenByType(BandDesignIntf::GroupFooter)){
renderBand(footer, 0, StartNewPageAsNeeded);
}
closeDataGroup(groupHeader);
}
void ReportRender::renderGroupFooter(BandDesignIntf *parentBand)
@ -772,14 +763,7 @@ void ReportRender::renderGroupFooter(BandDesignIntf *parentBand)
foreach(BandDesignIntf* band,parentBand->childrenByType(BandDesignIntf::GroupHeader)){
IGroupBand* gb = dynamic_cast<IGroupBand*>(band);
if (gb && gb->isStarted()){
if (band->reprintOnEachPage()) m_reprintableBands.removeOne(band);
foreach(BandDesignIntf* header, band->childrenByType(BandDesignIntf::GroupHeader)){
renderGroupFooterByHeader(header);
}
foreach(BandDesignIntf* footer, band->childrenByType(BandDesignIntf::GroupFooter)){
renderBand(footer, 0, StartNewPageAsNeeded);
}
closeDataGroup(band);
renderGroupFooterByHeader(band);
}
}
}