FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour xBrowse and TOTAL
Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
xBrowse and TOTAL
Posted: Fri Sep 20, 2013 04:50 PM
Mr Rao,

I test xBrowse with Total , I'd like to know why this works
Code (fw): Select all Collapse
   @ 10,10 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg ;
        ALIAS "CUST" ;
        COLUMNS "First" ;
        CELL LINES FOOTERS NOBORDER

   ADD COLUMN TO oBrw DATA FieldWBlock("Age",Select(caLMov)) ;
                HEADER "Age"  ALIGN  RIGHT 

   WITH OBJECT oBrw
      :nStretchCol         := 1
      :Age:nFooterType  := AGGR_SUM
      :MakeTotals()
      :CreateFromCode()  // omit for resource
   END


And this doesn't works (without COLUMNS "First" )
Code (fw): Select all Collapse
   @ 10,10 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg ;
        ALIAS "CUST" ;
        CELL LINES FOOTERS NOBORDER

   ADD COLUMN TO oBrw DATA FieldWBlock("Age",Select(caLMov)) ;
                HEADER "Age"  ALIGN  RIGHT 

   WITH OBJECT oBrw
      :nStretchCol         := 1
      :Age:nFooterType  := AGGR_SUM
      :MakeTotals()
      :CreateFromCode()  // omit for resource
   END

Thanks in anticipation
Maurizio
www.nipeservice.com
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xBrowse and TOTAL
Posted: Sat Sep 21, 2013 06:52 AM
Present behavior is that when XBrowse is created without specifying any columns ( or with autcols ) call to SetRDD() is deferred till initialization of xbrowse. In that case methods like MakeTotals() should be called in ON INIT clause in case of Dialogs and after CreateFromCode() in case of Windows.

I think we can and should change this behavior and we shall implement the changed behavior from the next release.

Meanwhile you can make this small change in your xbrowse.prg.

Please locate the following lines in function XbrwSetDataSource(...)
(line no:12621 in fwh13.08 2nd revision)
Code (fw): Select all Collapse
         if lAddCols .or. ! Empty( aCols )

Please change it as
Code (fw): Select all Collapse
         if .t.    // lAddCols .or. ! Empty( aCols )
Regards



G. N. Rao.

Hyderabad, India

Continue the discussion