0
0
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:
yanis60
2024-05-25 21:10:14 +01:00
parent 9d10ad6227
commit 7b7d4add4e
78 changed files with 31670 additions and 1093 deletions

View File

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

View File

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