Finish 1.4.82

# Conflicts:
#	limereport/lrreportrender.cpp
This commit is contained in:
Arin Alexander 2018-06-20 16:45:38 +03:00
commit a572b8c5d3
3 changed files with 100 additions and 3 deletions

View File

@ -101,6 +101,40 @@ QColor DataBand::bandColor() const
return QColor(Qt::darkGreen); return QColor(Qt::darkGreen);
} }
void DataBand::preparePopUpMenu(QMenu &menu)
{
BandDesignIntf::preparePopUpMenu(menu);
QAction* currAction = menu.addAction(tr("Keep footer together"));
currAction->setCheckable(true);
currAction->setChecked(keepFooterTogether());
currAction = menu.addAction(tr("Keep subdetail together"));
currAction->setCheckable(true);
currAction->setChecked(tryToKeepTogether());
currAction = menu.addAction(tr("Slice last row"));
currAction->setCheckable(true);
currAction->setChecked(sliceLastRow());
}
void DataBand::processPopUpAction(QAction *action)
{
BandDesignIntf::processPopUpAction(action);
if (action->text().compare(tr("Keep footer together")) == 0){
setProperty("keepFooterTogether",action->isChecked());
}
if (action->text().compare(tr("Keep subdetail together")) == 0){
setProperty("keepSubdetailTogether",action->isChecked());
}
if (action->text().compare(tr("Slice last row")) == 0){
setProperty("sliceLastRow",action->isChecked());
}
}
BaseDesignIntf *DataBand::createSameTypeItem(QObject *owner, QGraphicsItem *parent) BaseDesignIntf *DataBand::createSameTypeItem(QObject *owner, QGraphicsItem *parent)
{ {
return new DataBand(owner,parent); return new DataBand(owner,parent);
@ -113,6 +147,38 @@ DataHeaderBand::DataHeaderBand(QObject *owner, QGraphicsItem *parent)
setMarkerColor(bandColor()); setMarkerColor(bandColor());
} }
void DataHeaderBand::preparePopUpMenu(QMenu &menu)
{
BandDesignIntf::preparePopUpMenu(menu);
QAction* currAction = menu.addAction(tr("Reprint on each page"));
currAction->setCheckable(true);
currAction->setChecked(reprintOnEachPage());
currAction = menu.addAction(tr("Repeat on each row"));
currAction->setCheckable(true);
currAction->setChecked(repeatOnEachRow());
currAction = menu.addAction(tr("Print always"));
currAction->setCheckable(true);
currAction->setChecked(printAlways());
}
void DataHeaderBand::processPopUpAction(QAction *action)
{
BandDesignIntf::processPopUpAction(action);
if (action->text().compare(tr("Reprint on each page")) == 0){
setProperty("repeatOnEachPage",action->isChecked());
}
if (action->text().compare(tr("Repeat on each row")) == 0){
setProperty("repeatOnEachRow",action->isChecked());
}
if (action->text().compare(tr("Print always")) == 0){
setProperty("printAlways",action->isChecked());
}
}
DataFooterBand::DataFooterBand(QObject *owner, QGraphicsItem *parent) DataFooterBand::DataFooterBand(QObject *owner, QGraphicsItem *parent)
:BandDesignIntf(BandDesignIntf::DataFooter,xmlTagFooter,owner,parent) :BandDesignIntf(BandDesignIntf::DataFooter,xmlTagFooter,owner,parent)
{ {
@ -120,5 +186,21 @@ DataFooterBand::DataFooterBand(QObject *owner, QGraphicsItem *parent)
setMarkerColor(bandColor()); setMarkerColor(bandColor());
} }
void DataFooterBand::preparePopUpMenu(QMenu &menu)
{
BandDesignIntf::preparePopUpMenu(menu);
QAction* currAction = menu.addAction(tr("Print always"));
currAction->setCheckable(true);
currAction->setChecked(printAlways());
}
void DataFooterBand::processPopUpAction(QAction *action)
{
BandDesignIntf::processPopUpAction(action);
if (action->text().compare(tr("Print always")) == 0){
setProperty("printAlways",action->isChecked());
}
}
} }

View File

@ -57,6 +57,8 @@ public:
void processPopUpAction(QAction *action); void processPopUpAction(QAction *action);
protected: protected:
QColor bandColor() const; QColor bandColor() const;
void preparePopUpMenu(QMenu &menu);
void processPopUpAction(QAction *action);
private: private:
BaseDesignIntf* createSameTypeItem(QObject* owner=0, QGraphicsItem* parent=0); BaseDesignIntf* createSameTypeItem(QObject* owner=0, QGraphicsItem* parent=0);
}; };
@ -74,6 +76,9 @@ public:
bool isUnique() const {return false;} bool isUnique() const {return false;}
bool isHeader() const {return true;} bool isHeader() const {return true;}
QColor bandColor() const {return QColor(Qt::darkGreen);} QColor bandColor() const {return QColor(Qt::darkGreen);}
protected:
void preparePopUpMenu(QMenu &menu);
void processPopUpAction(QAction *action);
private: private:
BaseDesignIntf* createSameTypeItem(QObject* owner=0, QGraphicsItem* parent=0){ BaseDesignIntf* createSameTypeItem(QObject* owner=0, QGraphicsItem* parent=0){
return new DataHeaderBand(owner,parent); return new DataHeaderBand(owner,parent);
@ -91,6 +96,9 @@ public:
bool isUnique() const {return false;} bool isUnique() const {return false;}
bool isFooter() const {return true;} bool isFooter() const {return true;}
QColor bandColor() const{return QColor(Qt::darkGreen);} QColor bandColor() const{return QColor(Qt::darkGreen);}
protected:
void preparePopUpMenu(QMenu &menu);
void processPopUpAction(QAction *action);
private: private:
BaseDesignIntf* createSameTypeItem(QObject* owner=0, QGraphicsItem* parent=0){ BaseDesignIntf* createSameTypeItem(QObject* owner=0, QGraphicsItem* parent=0){
return new DataFooterBand(owner,parent); return new DataFooterBand(owner,parent);

View File

@ -603,6 +603,7 @@ void ReportRender::renderDataBand(BandDesignIntf *dataBand)
firstTime = false; firstTime = false;
} }
if (!dataBand->keepFooterTogether())
m_reprintableBands.removeOne(header); m_reprintableBands.removeOne(header);
if (header) recalcIfNeeded(header); if (header) recalcIfNeeded(header);
@ -611,8 +612,11 @@ void ReportRender::renderDataBand(BandDesignIntf *dataBand)
bandDatasource->next(); bandDatasource->next();
} }
if (footer && !footer->printAlways()) if (footer && !footer->printAlways()){
renderBand(footer, 0, StartNewPageAsNeeded); renderBand(footer, 0, StartNewPageAsNeeded);
if (dataBand->keepFooterTogether())
m_reprintableBands.removeOne(dataBand);
}
datasources()->deleteVariable(varName); datasources()->deleteVariable(varName);
@ -620,8 +624,11 @@ void ReportRender::renderDataBand(BandDesignIntf *dataBand)
renderBand(dataBand, 0, StartNewPageAsNeeded); renderBand(dataBand, 0, StartNewPageAsNeeded);
} }
if (footer && footer->printAlways()) if (footer && footer->printAlways()){
renderBand(footer, 0, StartNewPageAsNeeded); renderBand(footer, 0, StartNewPageAsNeeded);
if (dataBand->keepFooterTogether())
m_reprintableBands.removeOne(dataBand);
}
} }
void ReportRender::renderPageHeader(PageItemDesignIntf *patternPage) void ReportRender::renderPageHeader(PageItemDesignIntf *patternPage)