mirror of
https://github.com/fralx/LimeReport.git
synced 2025-10-04 20:07:54 +03:00
added border for page and lrgroupbands has a sorting property
This commit is contained in:
@@ -62,7 +62,7 @@ namespace LimeReport{
|
||||
|
||||
GroupBandHeader::GroupBandHeader(QObject *owner, QGraphicsItem *parent)
|
||||
: BandDesignIntf(BandDesignIntf::GroupHeader, xmlTagHeader, owner,parent),
|
||||
m_groupFiledName(""), m_groupStarted(false), m_resetPageNumber(false)
|
||||
m_groupFiledName(""), m_groupStarted(false), m_resetPageNumber(false),m_sortFieldNameBy(Qt::AscendingOrder)
|
||||
{
|
||||
setBandTypeText(tr("GroupHeader"));
|
||||
setFixedPos(false);
|
||||
@@ -95,7 +95,10 @@ void GroupBandHeader::startGroup(DataSourceManager* dataManager)
|
||||
if (dataManager->containsDatasource(datasourceName)){
|
||||
IDataSource* ds = dataManager->dataSource(datasourceName);
|
||||
if (ds && ds->columnIndexByName(m_groupFiledName)!=-1)
|
||||
{
|
||||
m_groupFieldValue=ds->data(m_groupFiledName);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (!m_condition.isEmpty()) m_conditionValue = calcCondition(dataManager);
|
||||
@@ -149,6 +152,7 @@ bool GroupBandHeader::isNeedToClose(DataSourceManager* dataManager)
|
||||
QString datasourceName = findDataSourceName(parentBand());
|
||||
if (dataManager->containsDatasource(datasourceName)){
|
||||
IDataSource* ds = dataManager->dataSource(datasourceName);
|
||||
|
||||
if (ds){
|
||||
if (ds->data(m_groupFiledName).isNull() && m_groupFieldValue.isNull()) return false;
|
||||
if (!ds->data(m_groupFiledName).isValid()) return false;
|
||||
|
@@ -32,12 +32,14 @@
|
||||
|
||||
#include "lrbanddesignintf.h"
|
||||
#include "lrdesignelementsfactory.h"
|
||||
#include "qnamespace.h"
|
||||
|
||||
namespace LimeReport{
|
||||
|
||||
class GroupBandHeader : public BandDesignIntf, public IGroupBand{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(QString groupFieldName READ groupFieldName WRITE setGroupFieldName)
|
||||
Q_PROPERTY(Qt::SortOrder SortFieldNameBy READ SortFieldNameBy WRITE setSortFieldNameBy)
|
||||
Q_PROPERTY(bool splittable READ isSplittable WRITE setSplittable )
|
||||
Q_PROPERTY(bool keepGroupTogether READ tryToKeepTogether WRITE setTryToKeepTogether)
|
||||
Q_PROPERTY(bool startNewPage READ startNewPage WRITE setStartNewPage)
|
||||
@@ -60,6 +62,8 @@ public:
|
||||
bool isGroupHeader() const {return true;}
|
||||
QString condition() const;
|
||||
void setCondition(const QString &condition);
|
||||
Qt::SortOrder SortFieldNameBy(){return m_sortFieldNameBy;};
|
||||
void setSortFieldNameBy(Qt::SortOrder sortOrder){m_sortFieldNameBy = sortOrder;}
|
||||
private:
|
||||
virtual BaseDesignIntf* createSameTypeItem(QObject* owner=0, QGraphicsItem* parent=0);
|
||||
void startGroup(DataSourceManager* dataManager);
|
||||
@@ -77,6 +81,7 @@ private:
|
||||
bool m_resetPageNumber;
|
||||
QString m_condition;
|
||||
QString m_conditionValue;
|
||||
Qt::SortOrder m_sortFieldNameBy;
|
||||
};
|
||||
|
||||
class GroupBandFooter : public BandDesignIntf{
|
||||
|
Reference in New Issue
Block a user