LimeReport Forum
General Category | Основное => Discussion | Обсуждение => Topic started by: merabi on November 24, 2018, 12:14:43 pm
-
Hello.
i am having problem using sum function. when column name in my data source contains space sum function doesn't sum column values and gives syntax error.
my data source is QTableModel based.
this is the script in table footer cell:
$S{numberFormat($S{ SUM("$D{datasource.თვითღ ფასი}","DataBand1") }, "f", 2, "")}
please let me know how to fix this problem.
p.s. in the table rows values are shown properly. only sum function has problem.
this is the script in table data cell:
$S{numberFormat($D{datasource.თვითღ ფასი}, "f", 2, "")}
-
Added Image Showing The Problem
-
Hi.
I've fixed the problem and pushed changes to github. Check it please.
-
Hi, our problem has resolved partially. In general your solution works except when column name contains dot.
For Example:
$S{numberFormat($S{SUM("$D{datasource.შესყ.ფასი}", "DataBand1")}, "f", 3, "")}
doesn't work.
-
Yet another attempt :) I've changed it and pushed. Check it please
-
Hi, this one is working, but when there is a space after dot script doesn't work.
For Example:
$S{numberFormat($S{SUM("$D{datasource.შესყ. ფასი}", "DataBand1")}, "f", 3, "")}
Thank you for a quick response.
-
Do you really need all this variants of field name? In fact it is not good practice to do a field name with spaces :)
-
I've made new changes. Check it please
-
Hi, now everything works as expected.
The reason we have such column names is that we are passing QTableModel as a data source.
Sometimes column names are large and contains multiple words. So they are shortened to achieve convenient look in a QTableView.
Thank you for your effort.