diff --git a/limereport/bands/lrdataband.h b/limereport/bands/lrdataband.h index 5e73d56..d19d4b9 100644 --- a/limereport/bands/lrdataband.h +++ b/limereport/bands/lrdataband.h @@ -63,6 +63,7 @@ class DataHeaderBand : public BandDesignIntf Q_PROPERTY(bool reprintOnEachPage READ reprintOnEachPage WRITE setReprintOnEachPage) Q_PROPERTY(int columnsCount READ columnsCount WRITE setColumnsCount) Q_PROPERTY(bool printAlways READ printAlways() WRITE setPrintAlways()) + Q_PROPERTY(bool repeatOnEachRow READ repeatOnEachRow WRITE setRepeatOnEachRow) public: DataHeaderBand(QObject* owner=0, QGraphicsItem* parent=0); bool isUnique() const {return false;} diff --git a/limereport/lrbanddesignintf.cpp b/limereport/lrbanddesignintf.cpp index 28fedc2..2cf1707 100644 --- a/limereport/lrbanddesignintf.cpp +++ b/limereport/lrbanddesignintf.cpp @@ -144,7 +144,8 @@ BandDesignIntf::BandDesignIntf(BandsType bandType, const QString &xmlTypeName, Q m_reprintOnEachPage(false), m_startNewPage(false), m_startFromNewPage(false), - m_printAlways(false) + m_printAlways(false), + m_repeatOnEachRow(false) { setPosibleResizeDirectionFlags(ResizeBottom); setPosibleMoveFlags(TopBotom); @@ -718,6 +719,16 @@ void BandDesignIntf::childBandDeleted(QObject *band) m_childBands.removeAt(m_childBands.indexOf(reinterpret_cast(band))); } +bool BandDesignIntf::repeatOnEachRow() const +{ + return m_repeatOnEachRow; +} + +void BandDesignIntf::setRepeatOnEachRow(bool repeatOnEachRow) +{ + m_repeatOnEachRow = repeatOnEachRow; +} + bool BandDesignIntf::printAlways() const { return m_printAlways; diff --git a/limereport/lrbanddesignintf.h b/limereport/lrbanddesignintf.h index 835aadf..6b7fb06 100644 --- a/limereport/lrbanddesignintf.h +++ b/limereport/lrbanddesignintf.h @@ -213,7 +213,8 @@ public: bool canContainChildren(){ return true;} bool printAlways() const; void setPrintAlways(bool printAlways); - + bool repeatOnEachRow() const; + void setRepeatOnEachRow(bool repeatOnEachRow); signals: void bandRendered(BandDesignIntf* band); protected: @@ -266,6 +267,7 @@ private: bool m_startNewPage; bool m_startFromNewPage; bool m_printAlways; + bool m_repeatOnEachRow; }; class DataBandDesignIntf : public BandDesignIntf{ diff --git a/limereport/lrreportrender.cpp b/limereport/lrreportrender.cpp index 508bf20..768f6aa 100644 --- a/limereport/lrreportrender.cpp +++ b/limereport/lrreportrender.cpp @@ -401,6 +401,9 @@ void ReportRender::renderDataBand(BandDesignIntf *dataBand) datasources()->updateChildrenData(dataBand->datasourceName()); m_lastDataBand = dataBand; + if (header && !firstTime && header->repeatOnEachRow()) + renderBand(header,StartNewPageAsNeeded); + renderBand(dataBand,StartNewPageAsNeeded,!bandDatasource->hasNext()); renderChildBands(dataBand);