fralx / LimeReport

Report generator for Qt Framework
http://limereport.ru/
Other
403 stars 154 forks source link

aggregate functions not working in the reportheader but only in the reportfooter #353

Open rmantovani68 opened 3 years ago

rmantovani68 commented 3 years ago

If I'm putting the field : $S{COUNT($D{colli_produzione_ordine.cpnmcol},"DataBand1")} in the reportfooter it works seamlessly If I'm putting the field in the reportheader it prints : Function COUNT not found or have wrong arguments Maybe it's because it has not yet calculated the sum or the count of the sql query...

rmantovani68 commented 3 years ago

Problem is in the method: QVariant ScriptFunctionsManager::calcGroupFunction(const QString &name, const QString &expressionID, const QString &bandName, QObject currentPage) that calls
GroupFunction
DataSourceManager::groupFunction(const QString &name, const QString &expression, const QString &band)

if called for ReportHeader the m_groupFunctions.count(band) is 0 if called for ReportFooter the m_groupFunctions.count(band) is the correct number of elements

fralx commented 3 years ago

Hi. At the moment the group functions not works for Report Header. You can use them only in the DataHeaders and GroupHeaders