xBrowse MakeTotals on Array Column

Post Reply
User avatar
Rick Lipkin
Posts: 2397
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

xBrowse MakeTotals on Array Column

Post by Rick Lipkin »

To All

I am creating a complex array from multiple data sources .. the second array column is one of those columns I want to sum up on the column footer. All I know is the column is aPlan [2] Header "Origional Budget"

How can I use MakeTotals() from an array column ?

Code: Select all

 // project plan ---------------------------

        REDEFINE xBROWSE oLbx3  ;
        ARRAY aPlan             ; 
        HEADERS "Budget Item",         ;
                     "Origional_Budget",    ;
                      "Budget Revision",     ;
                      "Current Budget",      ;
                      "Origional Contract",  ;
                      "Contract Revisions",  ;
                      "Current Committed",   ;
                      "Pending Proposals",   ;
                      "Potential Exposures", ;
                      "Potential Costs",     ;
                      "Potential Proj Costs"       ;
         COLSIZES 200,70,70,70,70,70,70,70,70,70,70 ; // 11
         ID 174 of oCust     ;
         AUTOCOLS CELL LINES

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

         WITH OBJECT oLbx3
                :aCols[2]:nFooterType  := AGGR_SUM   // <---------- here  .. does not work
                :MakeTotals()
          END


          oLbx3:aCols[2]:nDataStrAlign := AL_RIGHT  // orig budget
          oLbx3:aCols[2]:nHeadStrAlign := AL_RIGHT

          oLbx3:lRecordSelector := .f.

 
Thanks
Rick Lipkin
User avatar
Richard Chidiak
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France
Contact:

Re: xBrowse MakeTotals on Array Column

Post by Richard Chidiak »

Rick

WITH OBJECT oLbx3
:aCols[2]:nFooterType := AGGR_TOTAL
END

ODLG:bSTART := { || Olbx3:MAKETOTALS(),Olbx3:SETFOCUS() }

Hth

Richard
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Rick Lipkin
Posts: 2397
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: xBrowse MakeTotals on Array Column

Post by Rick Lipkin »

To All

I found out that as I was creating my array I used the TransForm() function to format the amount which converted the value to character. I decided to use the PICTURE clause on the xBrowse Column and I achieved my desired results.

Thanks to everyone.
Rick Lipkin

Code: Select all

// project plan ---------------------------

              REDEFINE xBROWSE oLbx3  ;
              ARRAY aPlan             ;
              HEADERS "Budget"+CRLF+"Item",         ;
                      "Origional"+CRLF+"Budget",    ;
                      "Budget"+CRLF+"Revision",     ;
                      "Current"+CRLF+"Budget",      ;
                      "Origional"+CRLF+"Contract",  ;
                      "Contract"+CRLF+"Revisions",  ;
                      "Current"+CRLF+"Committed",   ;
                      "Pending"+CRLF+"Proposals",   ;
                      "Potential"+CRLF+"Exposures", ;
                      "Potential"+CRLF+"Costs",     ;
                      "Potential"+CRLF+"Project Costs"       ;
              COLSIZES 200,70,70,70,70,70,70,70,70,70,70 ; // 11
              PICTURE "","999,999,999.99" ;
              ID 174 of oCust     ;
              AUTOCOLS CELL LINES


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

              WITH OBJECT oLbx3
                  :aCols[2]:nFooterType  := AGGR_SUM
                  :MakeTotals()
                  * :bLClickFooter    := { |r,c,f,o| FooterAggrClick( r, c, f, o ) }
              END


 
Image
Post Reply