Topic: tablegrid footer not summing

Good Morning Dmitry and MVD Team,
I have set a tablegrid column footer to sum a column (suppliers.totvalords which is defined as a 'calculated' field type). 
But if the cell value of suppliers.totvalords is blank, the column footer total also shows as blank (see screenshot dmitry - no totals 1.jpg). 
To try and correct this, I then formatted the column on the tablegrid to display as 0 but the column footer total still shows blank (see screenshot dmitry -no totals 2.jpg).
If I delete the row that contains the suppliers.totvalords blank cell, the column footer total sums correctly.
Is there a way to fix this?
Thankyou,
Derek

Post's attachments

Attachment icon purchase orders dmitry.zip 748.03 kb, 513 downloads since 2015-03-19 

2 (edited by mathmathou 2015-03-19 08:50:35)

Re: tablegrid footer not summing

OK, I think I found your bug smile


The problem was not with the blank line (no value or 0), but with the 'sfa' variable that was assigned to footer too early in your code, before the calculation. Only the last line was taken into account.


Try changing the line in red, it is misplaced - move it to the line in green, should work.


http://i.imgur.com/fUjBDVl.jpg


Math

I'm a very good housekeeper !
Each time I get a divorce, I keep the house

Zaza Gabor

Re: tablegrid footer not summing

derek
I assume that you are using an older version, this error has been fixed in newer versions.

Dmitry.

Re: tablegrid footer not summing

Hi Dmitry,
Yes, it sums the totvalords.column.footer correctly in Version 1.50.
I was going to try that but what was puzzling me was why it was able to sum totnumords.column.footer but not totvalords.column.footer - both fields are defined as calculations so i was expecting it to work for both columns or not at all.
Thanks for the quick response.
Derek.

Re: tablegrid footer not summing

Hello Mathmathou,
Thanks for taking the time to look through the script - messy, isn't it!!
As soon as i upgrade to 1.50, this problem (and probably some others too) will resolve themselves.
Derek.

Re: tablegrid footer not summing

Hello Dmitry and Derek,


@Derek : If by messy you mean complex and interesting idea, then yes your project is messy smile


@Derek and Dmitry : I am using latest version of the v1.50 (the one with version 4 in the .vdb file). Why would the first and third tablegrids work and not the second one if it's a version bug ?


The lack of calculation is still there, it only take into account the last line displayed in the tablegrid :


http://i.imgur.com/DTxl4Jw.png


@Derek and Dmitry : just change that line of code I showed you and it should work


http://i.imgur.com/bhfX9Yw.png

I'm a very good housekeeper !
Each time I get a divorce, I keep the house

Zaza Gabor

Re: tablegrid footer not summing

Well... I don't get it... I missed your post to Dmitry...


I don't understand why it works after upgrading for you while it does not for me with the same version ? Furthermore, why would 2 out of 3 tablegrids work and one not if this is a version bug ? Shouldn't the 3 tablegrids be broken as well ?


Anyway, glad you solved your problem smile


Math

I'm a very good housekeeper !
Each time I get a divorce, I keep the house

Zaza Gabor

Re: tablegrid footer not summing

Hello Dmitry, Mathmathou,
Although i am still on Version 1.45, i have nevertheless managed to get all the totals on my 3 grids working correctly now (i hope!!).
Thank you both for your advice and interest.
Derek.

Post's attachments

Attachment icon mathmathou.jpg 311.18 kb, 291 downloads since 2015-03-20