Page 1 of 1

footer de xbrowse.-

PostPosted: Tue Apr 26, 2011 7:19 am
by mag071
Saludos;

en un xbrowse quiero cambiar la justificaciones de los footers, uso el siguiente codigo:
Code: Select all  Expand view

   oBrw:lFooter   := .t.
   oBrw:aCols[ 2 ]:bFooter     := { || " "+Ltrim( Str( Len(::aData) ) ) }
   oBrw:aCols[ 2 ]:oFooterFont := oFootFont

   oBrw:aCols[ 3 ]:nFooterType := AGGR_TOTAL
   oBrw:aCols[ 3 ]:bLClickFooter:= { |r,c,f,o| ::VerListines( r, c, f, o ) }

   oBrw:aCols[ 4 ]:nFootStrAlign := AL_RIGHT
   oBrw:aCols[ 4 ]:nFooterType := AGGR_TOTAL
   oBrw:aCols[ 5 ]:nFooterType := AGGR_TOTAL
   oBrw:aCols[ 6 ]:nFooterType := AGGR_TOTAL


   oBrw:MakeTotals()
   oBrw:SetFocus()
 


en todas las columnas con footer tipo AGGR_TOTAL , me la justifica a la izquierda por defecto y no me toma el cambio.

agradecido como siempre por las ayudas prestadas en este foro.

Re: footer de xbrowse.-

PostPosted: Wed Apr 27, 2011 12:09 am
by FranciscoA
Hola, prueba con esto, a ver si te resuelve:

For n:=1 to len(oBrw:aCols)
if oBrw:aCols[n]:nFooterType = AGGR_TOTAL
oBrw:aCols[n]:nFootStrAlign := 1 //AL_RIGHT
endif
Next

Re: footer de xbrowse.-

PostPosted: Wed Apr 27, 2011 1:13 am
by mag071
Francisco;

Muchas Gracias por responder, pero igual no le hace caso a nFootStrAlign mi footer :-)

Image

Re: footer de xbrowse.-

PostPosted: Wed Apr 27, 2011 3:04 am
by armando.lagunas
Estimado:
creo que te falta esto

Code: Select all  Expand view

   oBrw:aCols[ 3 ]:nTotal   := 0
   oBrw:aCols[ 3 ]:lTotal   := .t.

   oBrw:aCols[ 3 ]:nFooterType := AGGR_TOTAL
   oBrw:aCols[ 3 ]:bLClickFooter:= { |r,c,f,o| ::VerListines( r, c, f, o ) }

   oBrw:aCols[ 4 ]:nFootStrAlign := AL_RIGHT
   oBrw:aCols[ 4 ]:nFooterType := AGGR_TOTAL
   oBrw:aCols[ 5 ]:nFooterType := AGGR_TOTAL
   oBrw:aCols[ 6 ]:nFooterType := AGGR_TOTAL
 


saludos

Re: footer de xbrowse.-

PostPosted: Wed Apr 27, 2011 5:36 am
by mag071
Armando ;

Agradecido por la repuesta, pero igual le coloco al xBrowse lo que me indicastes y sigue sin querer hacer la Justificación, como uno quiere.
Gracias.

Re: footer de xbrowse.-

PostPosted: Wed Apr 27, 2011 3:25 pm
by FranciscoA
Mario, este código me funciona correctamente: (10.06)
Lo que se me viene a la mente es que debes usar el objeto columna en vez del No. de Col. No sé. Quizás por la versión.

oCol2 = oBrw2:AddCol()
oCol2:bEditValue = { || (cWork2)->Debe }
oCol2:cEditPicture = "@Z 9,999,999,999.99"
oCol2:nEditType = 0 //no editable
oCol2:nDataStrAlign := 1
oCol2:cHeader = "Movimiento"+CRLF+"Del Debe"
oCol2:nWidth = 116
oCol2:lTotal := .t.
oCol2:nTotal:=0
oCol2:nFooterType := AGGR_TOTAL
oCol2:nFootStrAlign := 1

oCol2 = oBrw2:AddCol()
oCol2:bEditValue = { || (cWork2)->Haber }
oCol2:cEditPicture = "@Z 9,999,999,999.99"
oCol2:nEditType = 0 //no editable
oCol2:nDataStrAlign := 1
oCol2:cHeader = "Movimiento"+CRLF+"Del Haber"
oCol2:nWidth = 116
oCol2:lTotal := .t.
oCol2:nTotal:=0
oCol2:nFooterType := AGGR_TOTAL
oCol2:nFootStrAlign := 1

Re: footer de xbrowse.-

PostPosted: Wed Apr 27, 2011 8:48 pm
by acuellar
Mario intenta asi
Code: Select all  Expand view

oBrw:aCols[4]:bfooter:={|| Trans(AGGR_TOTAL,"@Z 9,999,999.99") }
 


Saludos,

Adhemar

Re: footer de xbrowse.-

PostPosted: Thu Apr 28, 2011 12:38 pm
by armando.lagunas
estimado:

estoy intrigado por lo que te sucede, te copio mi código en donde calculo el promedio de la lista.

puede que te falte el WITH OBJECT

Code: Select all  Expand view

            REDEFINE XBROWSE oBrw ID 30 OF xDlg COLUMNS "MONE","FECH","FACT" ALIAS "PA11" FONT oFont[3] AUTOSORT FOOTERS BACKGROUND aColor VERTICAL

                     oBrw:aCols[1]:cHeader       := 'Mon'
                     oBrw:aCols[1]:nWidth        := 40
                     oBrw:aCols[2]:cHeader       := 'Fecha'
                     oBrw:aCols[2]:nWidth        := 72
                     oBrw:aCols[3]:cHeader       := 'TCamb'
                     oBrw:aCols[3]:nWidth        := 85
                     oBrw:aCols[3]:bEditValue    := { || PA11->FACT }
                     oBrw:aCols[3]:nDataStrAlign := 1
                     oBrw:aCols[3]:cEditPicture  := "@Z 99,999.99"
                     oBrw:aCols[3]:nEditType     := EDIT_GET
                     oBrw:aCols[3]:bOnPostEdit   := { | oCol, xVal, nKey | IIF( nKey == VK_RETURN, (GrabaFactor( xVal, oGraph ),PA11->FACT := xVal) ,) }

                     WITH OBJECT oBrw:TCamb
                        oBrw:aCols[3]:oFooterFont   := oFont[7]
                        oBrw:aCols[3]:nFooterType   := AGGR_AVERAGE
                        oBrw:aCols[3]:bLClickFooter := { |r,c,f,o| FootClick( r, c, f, o ) }
                     END

                     oBrw:nMarqueeStyle        := 3
                     oBrw:nColDividerStyle     := 4
                     oBrw:nRowDividerStyle     := 4
                     oBrw:l2007                := .T.
                     oBrw:lVScroll             := .T.
                     oBrw:lFastEdit            := .T.
 

Image

saludos desde Chile

Re: footer de xbrowse.-

PostPosted: Thu Apr 28, 2011 2:53 pm
by mag071
Gracias por las respuestas;

pero igual no he podido hacer justifaciones en los footer , lo extraño que use el mismo ejemplo para el FWH 10.11 de fecha 12/Dic/2010 y luego use el FWH 11.04 28/Abr/2011.

Usando el siguiente codigo
Code: Select all  Expand view

  oBrw:lFooter   := .t.
   oBrw:aCols[ 2 ]:bFooter     := { || " "+Ltrim( Str( Len(::aData) ) ) }
   oBrw:aCols[ 2 ]:oFooterFont := oFootFont

   oBrw:aCols[ 3 ]:nFooterType := AGGR_TOTAL
   oBrw:aCols[ 3 ]:bLClickFooter:= { |r,c,f,o| ::VerListines( r, c, f, o ) }

   oBrw:aCols[ 4 ]:nFooterType := AGGR_TOTAL
   oBrw:aCols[ 4 ]:nFootStrAlign := AL_RIGHT
   oBrw:aCols[ 4 ]:RefreshFooter()

   oBrw:aCols[ 5 ]:nFooterType := AGGR_TOTAL
   oBrw:aCols[ 5 ]:nFootStrAlign := AL_LEFT
   oBrw:aCols[ 5 ]:RefreshFooter()


   oBrw:aCols[ 6 ]:nFooterType := AGGR_TOTAL
   oBrw:aCols[ 6 ]:nFootStrAlign := AL_CENTER
   oBrw:aCols[ 6 ]:RefreshFooter()



   oBrw:MakeTotals()
   oBrw:SetFocus()
   oBrw:Refresh()
 


Para el FWH 10.11 me justifica todo los footer hacia derecha, aqui dejo imagen
Image

Para el FWH 11.04 me justifica todos los footer hacia la izquierda
Image


solo quiero saber si es posible hacer justicaciones en los footer.

Gracias a todos.

Re: footer de xbrowse.-

PostPosted: Thu Apr 28, 2011 5:05 pm
by nageswaragunupudi
Mr. Mag071

It is surprising.
XBrowse aligns Data, Headers and Footers of all numeric columns to RIGHT by default. There is no need for us to specify align type.

Here is a self contained example:
Code: Select all  Expand view
#include "FiveWin.Ch"
#include "ord.ch"
#include "xbrowse.ch"

REQUEST DBFCDX

//----------------------------------------------------------------------------//

function Main()

   local oDlg, oBrw, oFont

   XbrNumFormat( "E", .t. )

   USE CUSTOMER VIA "DBFCDX"
   DEFINE FONT oFont NAME 'TAHOMA' SIZE 0,-12
   DEFINE DIALOG oDlg SIZE 400,400 PIXEL FONT oFont
   @ 10,10 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg ;
      COLUMNS "First", "Age", "Salary" ;
      ALIAS "CUSTOMER" CELL LINES FOOTERS NOBORDER

   oBrw:Age:nFooterType    := AGGR_AVG
   oBrw:Salary:nFooterType := AGGR_TOTAL
   oBrw:MakeTotals()

   oBrw:CreateFromCode()
   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont
   CLOSE CUSTOMER

return nil

//----------------------------------------------------------------------------//
 

Screeen Shot:
Image

I request you to post a self contained sample, using a dbf available in \fwh\samples folder, so that we can test here and solve your problem.

I used FWH 11.04