Skip to content

Commit

Permalink
startFromNewPage property has been added to Data band
Browse files Browse the repository at this point in the history
  • Loading branch information
fralx committed May 31, 2016
1 parent 54278cd commit d1f33e0
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
1 change: 1 addition & 0 deletions limereport/bands/lrdataband.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
13 changes: 12 additions & 1 deletion limereport/lrbanddesignintf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions limereport/lrbanddesignintf.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -256,6 +259,7 @@ private slots:
BandColumnsLayoutType m_columnsFillDirection;
bool m_reprintOnEachPage;
bool m_startNewPage;
bool m_startFromNewPage;
};

class DataBandDesignIntf : public BandDesignIntf{
Expand Down
3 changes: 2 additions & 1 deletion limereport/lrreportrender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit d1f33e0

Please sign in to comment.