PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → table auto calculations [WD21]
table auto calculations [WD21]
Débuté par iso, 31 mai 2016 16:25 - 6 réponses
Posté le 31 mai 2016 - 16:25
Hello.

I have a number of table controls which have quite a lot of records 20K+ they take a few seconds to populate which is fine, but the auto calculations (sum and counter) take a little longer, i have impatient users of the program clicking on things before these have been calculated. Is there a command to show when this has finished, table end initialization doesnt take into account the auto calculations.

thanks

ISO
Posté le 31 mai 2016 - 17:12
Hi iso,

The calculations can be performed by programming so should be within your control. Not tried it myself, but you could pop-up a "Calculating..." message box, set the calc(s) going and close the pop-up when the calc(s) are complete?

http://help.windev.com/en-US/…
http://help.windev.com/en-US/…
Posté le 31 mai 2016 - 21:00
Iso

Depends how you are getting your data.
I run a query and store the result in an array.
My table controls are bound to the queries.
Calculations are then carried out against the query - blisteringly quick as all in memory especially if you can incorporate associative arrays.

Finish with TableDisplay() and popuplate, if you have not already done so, the controls displaying the counts.

As this is all done in a single procedure you can use HourGlass() to prvent users doing what users always do when they are impatient.
Posté le 01 juin 2016 - 11:21
thanks guys

i added these lines to the table end of init,,

NoOf is int = myself.COL_IntStudentId[rowCount]
Close(WIN_Wait)

even though im using the auto calculations in the COL_IntStudentId which means this is calculated anyway. i still need the above code to know when to close the wait window.

thanks

iso
Posté le 01 juin 2016 - 11:39
I didn't test this but it may work.
init code
yourtable..TotalsEnabled = False

end of int code
openchild(WIN_Wait)
yourtable..TotalsEnabled = true
Close(WIN_Wait)

http://doc.windev.com/en-US/…
Posté le 01 juin 2016 - 14:06
Hi

I couldn't find out columnCount/columnSum/..Avg in a row

eg
A B C columnTotal
10 20 30 60
1 2 7 10

Appreciated if you could point out some tips and thx in advance

Cheers

King
Posté le 02 juin 2016 - 08:58
Hi Paulo

Yes i had actually tried that before it didn't work sadly.

Thanks

ISO