FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour xBrowse MakeTotals()
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
xBrowse MakeTotals()
Posted: Tue Nov 27, 2018 11:45 PM
Rao

I have a couple of questions for you .. here is my MakeTotals() and xBrowse Header code ..

Code (fw): Select all Collapse
 REDEFINE xBROWSE oLbxC             ;
         RECORDSET oRsQuota           ;
         COLUMNS "PERSNO",            ;
                 "EMPLOYEE",          ;
                 "QUOTA",             ;
                 "ENTITLEMENT",       ;
                 "USED",              ;
                 "REMONKEYDATE"       ;
         COLSIZES 122,190,120,120,120,120 ;
         HEADERS "PersNo",            ;
                 "Employee Name",     ;
                 "Quota",             ;
                 "Entitlement",       ;
                 "Used",              ;
                 "RemainderOnKeyDt" ;
         ID 133 of oGrps  ;
         AUTOCOLS FOOTERS LINES CELL

   oLbxC:nMarqueeStyle := MARQSTYLE_HIGHLROW
   oLbxC:lRecordSelector := .f.

   // add columns
   ADD oCol2 to oLbxC AT 7 DATA {|x| x := If(oRsQuota:Eof, ,_ChkHours(oRsQuota:Fields("REMONKEYDATE"):Value))};
                    HEADER "TotalDaysRemaining" size 120

   oLbxC:SetGroupHeader( 'Hours', 4, 6 )

   // column orientation
   oLbxC:aCols[7]:nDataStrAlign := AL_RIGHT  // days remaining
   oLbxC:aCols[7]:nHeadStrAlign := AL_CENTER
   oLbxC:aCols[6]:nHeadStrAlign := AL_CENTER

   oLbxC:lFooter   := .t.
   oCol1           := oLbxC:aCols[ 1 ]
   oCol1:bFooter   := { || Ltrim( Str( oLbxC:KeyNo() ) ) + " / " + LTrim( Str( oLbxC:KeyCount() ) ) }
   oLbxC:bChange   := { || oCol1:RefreshFooter() }

   WITH OBJECT oLbxC
        :Entitlement:nFooterType         := AGGR_SUM
        :Used:nFooterType                := AGGR_SUM
        :RemainderOnKeyDt:nFooterType    := AGGR_SUM
        :TotalDaysRemaining:nFooterType  := AGGR_SUM
        :MakeTotals()
   END


Lets take the header RemainderOnKeyDt .. If I define the header as :
:Remainder On KeyDt:nFooterType := AGGR_SUM

The compiler errors .. I can not leave any spaces .. is there a work around that would let me use spaces in then xBrowse Column header ? .. Also I have created a 7th column that just returns a numeric value .. The bottom MakeTotal() is skewed off to the left .. is there a way to align the MakeTotal footer to align to the right ? ..



Rick Lipkin
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xBrowse MakeTotals()
Posted: Tue Nov 27, 2018 11:58 PM

You can have the header as "Remainder On KeyDt" and still use "oBrw:RemainderOnKeyDt:nFooterType := AGGR_SUM"

Regards



G. N. Rao.

Hyderabad, India
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: xBrowse MakeTotals()
Posted: Wed Nov 28, 2018 03:40 PM

Rao

Thanks .. how do I shift the last column TotalDaysRemaining maktotals() footer to the right ?

Rick Lipkin

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xBrowse MakeTotals()
Posted: Wed Nov 28, 2018 04:05 PM

nFootStrAlign

Regards



G. N. Rao.

Hyderabad, India
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: xBrowse MakeTotals()
Posted: Wed Nov 28, 2018 04:21 PM

Rao

Thanks .. appreciate your Help!

Rick Lipkin

Continue the discussion