0
0
mirror of https://github.com/fralx/LimeReport.git synced 2025-10-09 14:04:43 +03:00

COUNT function can be called with only one databand argument

This commit is contained in:
Arin Alexander
2016-12-24 14:01:35 +03:00
parent 658a6e7e09
commit 081b422468
5 changed files with 34 additions and 8 deletions

View File

@@ -302,8 +302,17 @@ QScriptValue callGroupFunction(const QString& functionName, QScriptContext* pcon
ScriptEngineManager* sm = qscriptvalue_cast<ScriptEngineManager*>(pcontext->callee().data());
DataSourceManager* dm = sm->dataManager();
QString expression = pcontext->argument(0).toString();
QString band = pcontext->argument(1).toString();
QString expression;
QString band;
if (functionName.compare("COUNT",Qt::CaseInsensitive) == 0 && pcontext->argumentCount()==1){
expression = " ";
band = pcontext->argument(0).toString();
} else {
expression = pcontext->argument(0).toString();
band = pcontext->argument(1).toString();
}
QScriptValue res;
GroupFunction* gf = dm->groupFunction(functionName,expression,band);
if (gf){