Group band has been fixed

This commit is contained in:
Arin Alexander 2018-01-18 20:28:56 +03:00
parent f64a918ffe
commit a80a1298eb

View File

@ -724,13 +724,19 @@ void ReportRender::renderGroupHeader(BandDesignIntf *parentBand, IDataSource* da
} }
if (gb && !gb->isStarted()){ if (gb && !gb->isStarted()){
if (band->reprintOnEachPage()) if (band->reprintOnEachPage()){
m_reprintableBands.append(band); m_reprintableBands.append(band);
}
gb->startGroup(m_datasources); gb->startGroup(m_datasources);
openDataGroup(band); openDataGroup(band);
if (!firstTime && gb->startNewPage()){ if (!firstTime && gb->startNewPage()){
if (gb->resetPageNumber()) resetPageNumber(BandReset); if (gb->resetPageNumber()) resetPageNumber(BandReset);
if (band->reprintOnEachPage()){
savePage();
startNewPage();
} else {
renderBand(band, 0, ForcedStartPage); renderBand(band, 0, ForcedStartPage);
}
} else { } else {
renderBand(band, 0, StartNewPageAsNeeded); renderBand(band, 0, StartNewPageAsNeeded);
} }
@ -845,6 +851,14 @@ void ReportRender::closeDataGroup(BandDesignIntf *band)
if (groupBand){ if (groupBand){
groupBand->closeGroup(); groupBand->closeGroup();
if (band->reprintOnEachPage()) m_reprintableBands.removeOne(band); if (band->reprintOnEachPage()) m_reprintableBands.removeOne(band);
QList<BandDesignIntf*>::Iterator it = m_reprintableBands.begin();
while (it != m_reprintableBands.end()){
if ((*it)->bandIndex()>band->bandIndex())
it = m_reprintableBands.erase(it);
else
it++;
}
} }
closeGroup(band); closeGroup(band);
} }
@ -1094,7 +1108,6 @@ void ReportRender::startNewPage()
m_dataAreaSize = m_maxHeightByColumn[m_currentColumn]; m_dataAreaSize = m_maxHeightByColumn[m_currentColumn];
m_renderedDataBandCount = 0; m_renderedDataBandCount = 0;
foreach (BandDesignIntf* band, m_reprintableBands) { foreach (BandDesignIntf* band, m_reprintableBands) {
renderBand(band, 0); renderBand(band, 0);
} }