Merge branch '1.4' into 1.4_followTo
@@ -31,7 +31,6 @@
|
||||
#include "lrglobal.h"
|
||||
#include "lrdatasourcemanager.h"
|
||||
|
||||
|
||||
const QString xmlTagHeader = QLatin1String("GroupHeader");
|
||||
const QString xmlTagFooter = QLatin1String("GroupFooter");
|
||||
|
||||
@@ -98,6 +97,8 @@ void GroupBandHeader::startGroup(DataSourceManager* dataManager)
|
||||
if (ds && ds->columnIndexByName(m_groupFiledName)!=-1)
|
||||
m_groupFieldValue=ds->data(m_groupFiledName);
|
||||
}
|
||||
|
||||
if (!m_condition.isEmpty()) m_conditionValue = calcCondition(dataManager);
|
||||
}
|
||||
|
||||
QColor GroupBandHeader::bandColor() const
|
||||
@@ -114,20 +115,47 @@ QString GroupBandHeader::findDataSourceName(BandDesignIntf* parentBand){
|
||||
|
||||
}
|
||||
|
||||
QString GroupBandHeader::condition() const
|
||||
{
|
||||
return m_condition;
|
||||
}
|
||||
|
||||
void GroupBandHeader::setCondition(const QString &condition)
|
||||
{
|
||||
m_condition = condition;
|
||||
}
|
||||
|
||||
QString GroupBandHeader::calcCondition(DataSourceManager* dataManager){
|
||||
QString result = m_condition;
|
||||
if (!m_condition.isEmpty()){
|
||||
result=expandUserVariables(result, FirstPass, NoEscapeSymbols, dataManager);
|
||||
result=expandScripts(result, dataManager);
|
||||
result=expandDataFields(result, NoEscapeSymbols, dataManager);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
bool GroupBandHeader::isNeedToClose(DataSourceManager* dataManager)
|
||||
{
|
||||
if (!m_groupStarted) return false;
|
||||
if (m_groupFiledName.isNull() || m_groupFiledName.isEmpty())
|
||||
if ((m_groupFiledName.isNull() || m_groupFiledName.isEmpty()) && condition().isEmpty()){
|
||||
dataManager->putError(tr("Group field not found"));
|
||||
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;
|
||||
return ds->data(m_groupFiledName)!=m_groupFieldValue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_condition.isEmpty()){
|
||||
return m_conditionValue != calcCondition(dataManager);
|
||||
} else {
|
||||
dataManager->putError(tr("Datasource \"%1\" not found !!!").arg(datasourceName));
|
||||
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;
|
||||
return ds->data(m_groupFiledName)!=m_groupFieldValue;
|
||||
}
|
||||
} else {
|
||||
dataManager->putError(tr("Datasource \"%1\" not found !!!").arg(datasourceName));
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -141,6 +169,7 @@ bool GroupBandHeader::isStarted()
|
||||
void GroupBandHeader::closeGroup()
|
||||
{
|
||||
m_groupFieldValue=QVariant();
|
||||
m_conditionValue="";
|
||||
m_groupStarted=false;
|
||||
}
|
||||
|
||||
|
@@ -43,6 +43,7 @@ class GroupBandHeader : public BandDesignIntf, public IGroupBand{
|
||||
Q_PROPERTY(bool startNewPage READ startNewPage WRITE setStartNewPage)
|
||||
Q_PROPERTY(bool resetPageNumber READ resetPageNumber WRITE setResetPageNumber)
|
||||
Q_PROPERTY(bool reprintOnEachPage READ reprintOnEachPage WRITE setReprintOnEachPage)
|
||||
Q_PROPERTY(QString condition READ condition WRITE setCondition)
|
||||
public:
|
||||
GroupBandHeader(QObject* owner = 0, QGraphicsItem* parent=0);
|
||||
virtual bool isUnique() const;
|
||||
@@ -57,6 +58,8 @@ public:
|
||||
void setResetPageNumber(bool resetPageNumber);
|
||||
bool isHeader() const{return true;}
|
||||
bool isGroupHeader() const {return true;}
|
||||
QString condition() const;
|
||||
void setCondition(const QString &condition);
|
||||
private:
|
||||
virtual BaseDesignIntf* createSameTypeItem(QObject* owner=0, QGraphicsItem* parent=0);
|
||||
void startGroup(DataSourceManager* dataManager);
|
||||
@@ -65,12 +68,15 @@ private:
|
||||
void closeGroup();
|
||||
int index();
|
||||
QString findDataSourceName(BandDesignIntf *parentBand);
|
||||
QString calcCondition(DataSourceManager *dataManager);
|
||||
private:
|
||||
QVariant m_groupFieldValue;
|
||||
QString m_groupFiledName;
|
||||
bool m_groupStarted;
|
||||
//bool m_startNewPage;
|
||||
bool m_resetPageNumber;
|
||||
QString m_condition;
|
||||
QString m_conditionValue;
|
||||
};
|
||||
|
||||
class GroupBandFooter : public BandDesignIntf{
|
||||
|
Before Width: | Height: | Size: 387 B After Width: | Height: | Size: 655 B |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 698 B After Width: | Height: | Size: 821 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 726 B After Width: | Height: | Size: 821 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 936 B After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 884 B After Width: | Height: | Size: 1019 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 890 B After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1000 B After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 508 B After Width: | Height: | Size: 555 B |
Before Width: | Height: | Size: 761 B After Width: | Height: | Size: 742 B |
Before Width: | Height: | Size: 294 B After Width: | Height: | Size: 408 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 830 B |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 844 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 867 B |
Before Width: | Height: | Size: 692 B After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 717 B After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 411 B After Width: | Height: | Size: 472 B |
Before Width: | Height: | Size: 904 B After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 635 B After Width: | Height: | Size: 787 B |
Before Width: | Height: | Size: 537 B After Width: | Height: | Size: 646 B |
Before Width: | Height: | Size: 725 B After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 497 B After Width: | Height: | Size: 644 B |
Before Width: | Height: | Size: 713 B After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 489 B After Width: | Height: | Size: 645 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 577 B After Width: | Height: | Size: 674 B |
Before Width: | Height: | Size: 909 B After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 814 B After Width: | Height: | Size: 923 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 767 B After Width: | Height: | Size: 856 B |
Before Width: | Height: | Size: 775 B After Width: | Height: | Size: 856 B |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 929 B After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 901 B After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 912 B After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 644 B After Width: | Height: | Size: 809 B |
Before Width: | Height: | Size: 618 B After Width: | Height: | Size: 673 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 404 B |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 398 B |
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 6.0 KiB |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 394 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 426 B |
Before Width: | Height: | Size: 401 B After Width: | Height: | Size: 450 B |
Before Width: | Height: | Size: 427 B After Width: | Height: | Size: 205 B |
BIN
limereport/images/addBand2.png
Normal file
After Width: | Height: | Size: 229 B |
Before Width: | Height: | Size: 201 B After Width: | Height: | Size: 345 B |
Before Width: | Height: | Size: 211 B After Width: | Height: | Size: 397 B |
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 229 B After Width: | Height: | Size: 398 B |
Before Width: | Height: | Size: 209 B After Width: | Height: | Size: 374 B |
Before Width: | Height: | Size: 217 B After Width: | Height: | Size: 374 B |
Before Width: | Height: | Size: 497 B After Width: | Height: | Size: 713 B |
Before Width: | Height: | Size: 749 B After Width: | Height: | Size: 692 B |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 820 B After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 769 B After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 862 B After Width: | Height: | Size: 1018 B |
Before Width: | Height: | Size: 595 B After Width: | Height: | Size: 689 B |
Before Width: | Height: | Size: 891 B After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 581 B After Width: | Height: | Size: 690 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 859 B |
Before Width: | Height: | Size: 983 B After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 826 B After Width: | Height: | Size: 903 B |
Before Width: | Height: | Size: 698 B After Width: | Height: | Size: 821 B |
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.4 KiB |
BIN
limereport/images/delete2.png
Normal file
After Width: | Height: | Size: 460 B |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1000 B After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 955 B After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 725 B After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1015 B After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 661 B After Width: | Height: | Size: 887 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 344 B After Width: | Height: | Size: 416 B |
Before Width: | Height: | Size: 353 B After Width: | Height: | Size: 413 B |
BIN
limereport/images/edit_control_4_24.png
Normal file
After Width: | Height: | Size: 290 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 608 B After Width: | Height: | Size: 639 B |
Before Width: | Height: | Size: 620 B After Width: | Height: | Size: 605 B |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 199 B After Width: | Height: | Size: 341 B |