MAKETOTALS MAS VALOR DE UNA VARIABLE

MAKETOTALS MAS VALOR DE UNA VARIABLE

Postby joseluisysturiz » Thu Apr 21, 2016 10:05 pm

Saludos, asi como lo dice la pregunta, se le puede agregar o sumar al valor del maketotals de una columna el valor de una variable y se muestre ese resultado en el footer o maketotals solo procesa los valores de la columna de xbrowse.? o se podra usar bSumCondition .? no se si se podra forzar aCols[n]:nTotal, algo como:

oBrw:aCols[n]:nTotal := aCols[n]:nTotal + nValor
oBrw:refresh()

espero alguna sugerencia o sample, gracias, saludos... :shock:
Dios no está muerto...

Gracias a mi Dios ante todo!
User avatar
joseluisysturiz
 
Posts: 2064
Joined: Fri Jan 06, 2006 9:28 pm
Location: Guatire - Caracas - Venezuela

Re: MAKETOTALS MAS VALOR DE UNA VARIABLE

Postby nageswaragunupudi » Mon Apr 25, 2016 2:08 am

First please make this change in xbrowse.prg.
In the METHOD RecalcTotal( nOldVal, nNewVal ) CLASS TXBrwColumn
Change this line
Code: Select all  Expand view
     if ::bFooter != nil

as
Code: Select all  Expand view
     if ::bFooter != nil .and. Empty( ::nFooterType )
 


Please use this modified xbrowse.prg in all your projects
We are making this change in FWH 16.04

Now,

oCol:nFooterType := AGGR_SUM
oCol:bFooter := { |o| o:nTotal + nValor }

You may test with this sample
Code: Select all  Expand view
function testx()

   local oDlg, oBrw, oFont

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
   DEFINE DIALOG oDlg SIZE 300,300 PIXEL TRUEPIXEL FONT oFont

   @ 20,10 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
      DATASOURCE { 1, 2, 3, 4 } COLUMNS 1 ;
      CELL LINES NOBORDER FOOTERS FASTEDIT


   WITH OBJECT oBrw
      WITH OBJECT :aCols[ 1 ]
         :nEditType   := EDIT_GET
         :nFooterType := AGGR_SUM
         :bFooter     := { |o| o:nTotal + 100 }
      END
      :MakeTotals()
      :CreateFromCode()
   END

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont

return nil

 
Regards

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

Re: MAKETOTALS MAS VALOR DE UNA VARIABLE-SOLUCIONADO

Postby joseluisysturiz » Tue Apr 26, 2016 4:17 am

Mr. Nages...simplemente perfecto..muchas gracias por la solucion y que bueno sea una opcion disponible para una nueva version de FW, saludos... :shock:
Dios no está muerto...

Gracias a mi Dios ante todo!
User avatar
joseluisysturiz
 
Posts: 2064
Joined: Fri Jan 06, 2006 9:28 pm
Location: Guatire - Caracas - Venezuela


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: groiss and 75 guests