by nageswaragunupudi » Mon Jan 16, 2012 8:50 pm
Mr EMG is right.
MakeTotals() is a handy method to avoid complex coding but is not optimized for speed. Instead this method is coded to provide highest degree of flexibility.
While this is suitable for tables in memory ( arrays, recordsets ) and small and medium tables, it is not suitable for large tables and in particular tables on networks.
In such cases the programmer has to adopt his own ways to optimize recomputation of aggregates in the footers.
Also, once MakeTotals() is called in the beginning, it is not necessary to call this method for every refresh. Any inline editing of the values in the table automatically update the aggregates ( without retotalling ) and refresh the footer. Normally there should be no need to call the method again.
If the programmer intends to substitute the value of a column, he may use oCol:VarPut( nNewValue ). This will suitably adjust the aggregate and refresh the footer.
Exceptions: Add a row, delete a row or re-read the entire data.
While adding or deleting a row, the programmer may choose between updating the totals programatically or by calling maketotals() method again, considering the performance issues.
All said and done, by experience we find MakeTotals() is still very useful and we never notice any performance sluggishness in a majority of cases. Best use of this method is while handling complex aggregates like STDEV, etc which otherwise require lots of coding.
So, whether to use the method MakeTotals() or not either in the beginning or while refreshing is left to the best judgment of the programmer.
Regards
G. N. Rao.
Hyderabad, India