startFromNewPage property has been added to Data band

This commit is contained in:
Arin Alexander 2016-05-31 15:07:57 +03:00
parent 54278cdb37
commit d1f33e095b
4 changed files with 19 additions and 2 deletions

View File

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

View File

@ -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<BandDesignIntf*>(band)));
}
bool BandDesignIntf::startFromNewPage() const
{
return m_startFromNewPage;
}
void BandDesignIntf::setStartFromNewPage(bool startWithNewPage)
{
m_startFromNewPage = startWithNewPage;
}
bool BandDesignIntf::startNewPage() const
{
return m_startNewPage;

View File

@ -206,6 +206,9 @@ public:
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:
BandColumnsLayoutType m_columnsFillDirection;
bool m_reprintOnEachPage;
bool m_startNewPage;
bool m_startFromNewPage;
};
class DataBandDesignIntf : public BandDesignIntf{

View File

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