From a80a1298ebc8862961a244037edadfb47722a0c9 Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Thu, 18 Jan 2018 20:28:56 +0300 Subject: [PATCH] Group band has been fixed --- limereport/lrreportrender.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/limereport/lrreportrender.cpp b/limereport/lrreportrender.cpp index 1cdc23a..6bc1d2a 100644 --- a/limereport/lrreportrender.cpp +++ b/limereport/lrreportrender.cpp @@ -724,13 +724,19 @@ void ReportRender::renderGroupHeader(BandDesignIntf *parentBand, IDataSource* da } if (gb && !gb->isStarted()){ - if (band->reprintOnEachPage()) + if (band->reprintOnEachPage()){ m_reprintableBands.append(band); + } gb->startGroup(m_datasources); openDataGroup(band); if (!firstTime && gb->startNewPage()){ if (gb->resetPageNumber()) resetPageNumber(BandReset); - renderBand(band, 0, ForcedStartPage); + if (band->reprintOnEachPage()){ + savePage(); + startNewPage(); + } else { + renderBand(band, 0, ForcedStartPage); + } } else { renderBand(band, 0, StartNewPageAsNeeded); } @@ -845,6 +851,14 @@ void ReportRender::closeDataGroup(BandDesignIntf *band) if (groupBand){ groupBand->closeGroup(); if (band->reprintOnEachPage()) m_reprintableBands.removeOne(band); + + QList::Iterator it = m_reprintableBands.begin(); + while (it != m_reprintableBands.end()){ + if ((*it)->bandIndex()>band->bandIndex()) + it = m_reprintableBands.erase(it); + else + it++; + } } closeGroup(band); } @@ -1094,7 +1108,6 @@ void ReportRender::startNewPage() m_dataAreaSize = m_maxHeightByColumn[m_currentColumn]; m_renderedDataBandCount = 0; - foreach (BandDesignIntf* band, m_reprintableBands) { renderBand(band, 0); }