Page 1 of 1

xBrowse MakeTotals on Array Column

Posted: Wed Aug 05, 2015 9:46 pm
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

Re: xBrowse MakeTotals on Array Column

Posted: Thu Aug 06, 2015 4:36 am
by Richard Chidiak
Rick

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

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

Hth

Richard

Re: xBrowse MakeTotals on Array Column

Posted: Thu Aug 06, 2015 1:13 pm
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