xBrowse and TOTAL

xBrowse and TOTAL

Postby Maurizio » Fri Sep 20, 2013 4:50 pm

Mr Rao,

I test xBrowse with Total , I'd like to know why this works
Code: Select all  Expand view
  @ 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: Select all  Expand view
  @ 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
User avatar
Maurizio
 
Posts: 824
Joined: Mon Oct 10, 2005 1:29 pm

Re: xBrowse and TOTAL

Postby nageswaragunupudi » Sat Sep 21, 2013 6: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: Select all  Expand view
        if lAddCols .or. ! Empty( aCols )
 

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

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 97 guests