FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour footer de xbrowse.-
Posts: 140
Joined: Thu Feb 02, 2006 12:09 PM
footer de xbrowse.-
Posted: Tue Apr 26, 2011 07:19 AM
Saludos;

en un xbrowse quiero cambiar la justificaciones de los footers, uso el siguiente codigo:
Code (fw): Select all Collapse
   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
Posts: 2170
Joined: Fri Jul 18, 2008 01:24 AM
Re: footer de xbrowse.-
Posted: Wed Apr 27, 2011 12:09 AM

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.



Fwxh-MySql-TMySql
Posts: 140
Joined: Thu Feb 02, 2006 12:09 PM
Re: footer de xbrowse.-
Posted: Wed Apr 27, 2011 01:13 AM
Francisco;

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

Mario Antonio González Osal

Venezuela

m a g 0 7 1 @ g m a i l. c o m
Posts: 346
Joined: Mon Oct 05, 2009 03:35 PM
Re: footer de xbrowse.-
Posted: Wed Apr 27, 2011 03:04 AM
Estimado:
creo que te falta esto

Code (fw): Select all Collapse
   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
SkyPe: armando.lagunas@hotmail.com

Mail: armando.lagunas@gmail.com
Posts: 140
Joined: Thu Feb 02, 2006 12:09 PM
Re: footer de xbrowse.-
Posted: Wed Apr 27, 2011 05:36 AM

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
Posts: 2170
Joined: Fri Jul 18, 2008 01:24 AM
Re: footer de xbrowse.-
Posted: Wed Apr 27, 2011 03:25 PM

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.



Fwxh-MySql-TMySql
Posts: 1710
Joined: Tue Oct 28, 2008 06:26 PM
Re: footer de xbrowse.-
Posted: Wed Apr 27, 2011 08:48 PM
Mario intenta asi
Code (fw): Select all Collapse
oBrw:aCols[4]:bfooter:={|| Trans(AGGR_TOTAL,"@Z 9,999,999.99") }


Saludos,

Adhemar
Saludos,



Adhemar C.
Posts: 346
Joined: Mon Oct 05, 2009 03:35 PM
Re: footer de xbrowse.-
Posted: Thu Apr 28, 2011 12:38 PM
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 (fw): Select all Collapse
            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.



saludos desde Chile
SkyPe: armando.lagunas@hotmail.com

Mail: armando.lagunas@gmail.com
Posts: 140
Joined: Thu Feb 02, 2006 12:09 PM
Re: footer de xbrowse.-
Posted: Thu Apr 28, 2011 02:53 PM
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 (fw): Select all Collapse
  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


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



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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: footer de xbrowse.-
Posted: Thu Apr 28, 2011 05:05 PM
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 (fw): Select all Collapse
#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:


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

Continue the discussion