0
0
mirror of https://github.com/fralx/LimeReport.git synced 2024-12-24 00:33:02 +03:00

repeatOnEachRow property has been added to DataHeader

This commit is contained in:
Arin Alex 2016-07-27 00:41:24 +03:00
parent 77f6129c1f
commit 8e632855b4
4 changed files with 19 additions and 2 deletions

View File

@ -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;}

View File

@ -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<BandDesignIntf*>(band)));
}
bool BandDesignIntf::repeatOnEachRow() const
{
return m_repeatOnEachRow;
}
void BandDesignIntf::setRepeatOnEachRow(bool repeatOnEachRow)
{
m_repeatOnEachRow = repeatOnEachRow;
}
bool BandDesignIntf::printAlways() const
{
return m_printAlways;

View File

@ -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{

View File

@ -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);