LimeReport Forum

General Category | Основное => Discussion | Обсуждение => Topic started by: merabi on November 24, 2018, 12:14:43 PM

Title: Problem With SUM Function
Post 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:
Code: [Select]
$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:
Code: [Select]
$S{numberFormat($D{datasource.თვითღ ფასი}, "f", 2, "")}
Title: Re: Problem With SUM Function
Post by: merabi on November 24, 2018, 12:19:04 PM
Added Image Showing The Problem
Title: Re: Problem With SUM Function
Post by: Arin Alex on November 26, 2018, 10:04:51 PM
Hi.
I've fixed the problem and pushed changes to github. Check it please.
Title: Re: Problem With SUM Function
Post by: merabi on November 29, 2018, 10:31:34 AM
Hi, our problem has resolved partially. In general your solution works except when column name contains dot.
For Example:
Code: [Select]
$S{numberFormat($S{SUM("$D{datasource.შესყ.ფასი}", "DataBand1")}, "f", 3, "")}doesn't work.
Title: Re: Problem With SUM Function
Post by: Arin Alex on November 29, 2018, 11:02:41 PM
Yet another attempt :) I've changed it and pushed. Check it please
Title: Re: Problem With SUM Function
Post by: merabi on November 30, 2018, 12:59:20 PM
Hi, this one is working, but when there is a space after dot script doesn't work.
For Example:
Code: [Select]
$S{numberFormat($S{SUM("$D{datasource.შესყ. ფასი}", "DataBand1")}, "f", 3, "")}Thank you for a quick response.
Title: Re: Problem With SUM Function
Post by: Arin Alex on November 30, 2018, 04:55:50 PM
Do you really need all this variants of field name? In fact it is not good practice to do a field name with spaces :)
Title: Re: Problem With SUM Function
Post by: Arin Alex on December 01, 2018, 12:21:53 AM
I've made new changes. Check it please 
Title: Re: Problem With SUM Function
Post by: merabi on December 01, 2018, 10:44:20 AM
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.