footer de xbrowse.-

Post Reply
User avatar
mag071
Posts: 139
Joined: Thu Feb 02, 2006 12:09 pm
Location: Venezuela
Contact:

footer de xbrowse.-

Post by mag071 »

Saludos;

en un xbrowse quiero cambiar la justificaciones de los footers, uso el siguiente codigo:

Code: Select all

   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.
Mario Antonio González Osal
Venezuela
m a g 0 7 1 @ g m a i l. c o m
User avatar
FranciscoA
Posts: 1964
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: footer de xbrowse.-

Post 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
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh1204-MySql-TMySql
User avatar
mag071
Posts: 139
Joined: Thu Feb 02, 2006 12:09 pm
Location: Venezuela
Contact:

Re: footer de xbrowse.-

Post by mag071 »

Francisco;

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

Image
Mario Antonio González Osal
Venezuela
m a g 0 7 1 @ g m a i l. c o m
User avatar
armando.lagunas
Posts: 340
Joined: Mon Oct 05, 2009 3:35 pm
Location: Curico-Chile
Contact:

Re: footer de xbrowse.-

Post by armando.lagunas »

Estimado:
creo que te falta esto

Code: Select all

   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
User avatar
mag071
Posts: 139
Joined: Thu Feb 02, 2006 12:09 pm
Location: Venezuela
Contact:

Re: footer de xbrowse.-

Post 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.
Mario Antonio González Osal
Venezuela
m a g 0 7 1 @ g m a i l. c o m
User avatar
FranciscoA
Posts: 1964
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: footer de xbrowse.-

Post 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
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh1204-MySql-TMySql
User avatar
acuellar
Posts: 1312
Joined: Tue Oct 28, 2008 6:26 pm
Location: Santa Cruz-Bolivia

Re: footer de xbrowse.-

Post by acuellar »

Mario intenta asi

Code: Select all

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

Adhemar
Saludos,

Adhemar C.
User avatar
armando.lagunas
Posts: 340
Joined: Mon Oct 05, 2009 3:35 pm
Location: Curico-Chile
Contact:

Re: footer de xbrowse.-

Post 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

            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
User avatar
mag071
Posts: 139
Joined: Thu Feb 02, 2006 12:09 pm
Location: Venezuela
Contact:

Re: footer de xbrowse.-

Post 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

  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.
Mario Antonio González Osal
Venezuela
m a g 0 7 1 @ g m a i l. c o m
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: footer de xbrowse.-

Post 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

#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
Regards

G. N. Rao.
Hyderabad, India
Post Reply