xBrowse:MakeTotals()

xBrowse:MakeTotals()

Postby ukservice » Fri Jan 13, 2012 11:53 am

Hello,

When doing an xBrowse refresh() or update(), why maketotals are not updated?.

Thanks.
FWH 11.11, Harbour 3.1 and Borland C++ 5.82
User avatar
ukservice
 
Posts: 417
Joined: Tue Feb 23, 2010 3:09 pm
Location: John

Re: xBrowse:MakeTotals()

Postby pablovidal » Fri Jan 13, 2012 12:13 pm

Code: Select all  Expand view

 oBrw:MakeTotal()
 oBrw:Refresh()
 
Saludos,

Pablo Alberto Vidal
/*
------------------------------------------------------
Harbour 3.2.0, Fivewin 17.02, BCC7
------------------------------------------------------
*/
User avatar
pablovidal
 
Posts: 401
Joined: Thu Oct 06, 2005 10:15 pm
Location: Republica Dominicana

Re: xBrowse:MakeTotals()

Postby ukservice » Fri Jan 13, 2012 12:23 pm

Yes, in order to fix it I call oBrowse:MakeTotals()

But why it is not done automatically?.

Thanks.
FWH 11.11, Harbour 3.1 and Borland C++ 5.82
User avatar
ukservice
 
Posts: 417
Joined: Tue Feb 23, 2010 3:09 pm
Location: John

Re: xBrowse:MakeTotals()

Postby Enrico Maria Giordano » Fri Jan 13, 2012 12:50 pm

To not slow down the refresh method, I suppose.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8377
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: xBrowse:MakeTotals()

Postby 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
User avatar
nageswaragunupudi
 
Posts: 10308
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: xBrowse:MakeTotals()

Postby ukservice » Mon Jan 16, 2012 8:56 pm

Thanks a lot.

it is working fine as it is not a big table.

xBrowse is so much powerful ;)
FWH 11.11, Harbour 3.1 and Borland C++ 5.82
User avatar
ukservice
 
Posts: 417
Joined: Tue Feb 23, 2010 3:09 pm
Location: John


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 53 guests