From d1f33e095bf9002fe7abaea53f0f007036f53352 Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Tue, 31 May 2016 15:07:57 +0300 Subject: [PATCH] startFromNewPage property has been added to Data band --- limereport/bands/lrdataband.h | 1 + limereport/lrbanddesignintf.cpp | 13 ++++++++++++- limereport/lrbanddesignintf.h | 4 ++++ limereport/lrreportrender.cpp | 3 ++- 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/limereport/bands/lrdataband.h b/limereport/bands/lrdataband.h index cc7b81db..eebba46c 100644 --- a/limereport/bands/lrdataband.h +++ b/limereport/bands/lrdataband.h @@ -46,6 +46,7 @@ class DataBand : public DataBandDesignIntf Q_PROPERTY(int columnsCount READ columnsCount WRITE setColumnsCount) Q_PROPERTY(BandColumnsLayoutType columnsFillDirection READ columnsFillDirection WRITE setColumnsFillDirection) Q_PROPERTY(bool startNewPage READ startNewPage WRITE setStartNewPage) + Q_PROPERTY(bool startFromNewPage READ startFromNewPage WRITE setStartFromNewPage) public: DataBand(QObject* owner = 0, QGraphicsItem* parent=0); bool isUnique() const; diff --git a/limereport/lrbanddesignintf.cpp b/limereport/lrbanddesignintf.cpp index d0962ba4..fe6c1391 100644 --- a/limereport/lrbanddesignintf.cpp +++ b/limereport/lrbanddesignintf.cpp @@ -142,7 +142,8 @@ BandDesignIntf::BandDesignIntf(BandsType bandType, const QString &xmlTypeName, Q m_columnIndex(0), m_columnsFillDirection(Horizontal), m_reprintOnEachPage(false), - m_startNewPage(false) + m_startNewPage(false), + m_startFromNewPage(false) { setPosibleResizeDirectionFlags(ResizeBottom); setPosibleMoveFlags(TopBotom); @@ -698,6 +699,16 @@ void BandDesignIntf::childBandDeleted(QObject *band) m_childBands.removeAt(m_childBands.indexOf(reinterpret_cast(band))); } +bool BandDesignIntf::startFromNewPage() const +{ + return m_startFromNewPage; +} + +void BandDesignIntf::setStartFromNewPage(bool startWithNewPage) +{ + m_startFromNewPage = startWithNewPage; +} + bool BandDesignIntf::startNewPage() const { return m_startNewPage; diff --git a/limereport/lrbanddesignintf.h b/limereport/lrbanddesignintf.h index 21235faf..be282fa5 100644 --- a/limereport/lrbanddesignintf.h +++ b/limereport/lrbanddesignintf.h @@ -206,6 +206,9 @@ class BandDesignIntf : public BaseDesignIntf void setAutoHeight(bool value){m_autoHeight=value;} bool autoHeight(){return m_autoHeight;} + bool startFromNewPage() const; + void setStartFromNewPage(bool startFromNewPage); + signals: void bandRendered(BandDesignIntf* band); protected: @@ -256,6 +259,7 @@ private slots: BandColumnsLayoutType m_columnsFillDirection; bool m_reprintOnEachPage; bool m_startNewPage; + bool m_startFromNewPage; }; class DataBandDesignIntf : public BandDesignIntf{ diff --git a/limereport/lrreportrender.cpp b/limereport/lrreportrender.cpp index 27d3b30f..c1b84cae 100644 --- a/limereport/lrreportrender.cpp +++ b/limereport/lrreportrender.cpp @@ -381,7 +381,8 @@ void ReportRender::renderDataBand(BandDesignIntf *dataBand) while(!bandDatasource->eof() && !m_renderCanceled){ - if (!firstTime && dataBand->startNewPage()) { + if ((firstTime && dataBand->startFromNewPage()) || + (!firstTime && dataBand->startNewPage())) { savePage(); startNewPage(); }