No refresca totales con TXBrowse ,Solucionado!!?

No refresca totales con TXBrowse ,Solucionado!!?

Postby ACC69 » Thu Aug 23, 2012 10:10 pm

Hola buenas tardes, me estoy iniciandome con TXBrowse, me muestra los datos, bien sin problemas, ahora porque no me justifica, y por otro lado, quiero mostrar en footer, los totales, o importe total, pero me marca error de arrays, o que estare haciendo mal, de esa forma estoy creando TXBrowse, con recursos , que es mas facil y rapido de crear,digo yo, .

Me podran echar la mano?

Gracias y buen dia .


Code: Select all  Expand view  RUN
#Include "FiveWin.ch"
#Include "xBrowse.ch"

 *+CRLF+"Póliza"

STATIC oDlg
STATIC S12, S13
STATIC nTotal1,nTotal2,aSum

MemVar oWnd, oMOpc, nNumEmp, cDescrEmp, Mes_Per, Ano_Per, nStation

//------------------------------------------------------------------------------
FUNCTION MOD_PBAS()
 LOCAL oItem:=oMOpc,oBrw,oBrw2,oCol,oCol2

 S12 := Abre_Dbf(12,12) // Abre: POLZxMxA.DBF
 S13 := Abre_Dbf(13,13) // Abre: MOVTxMxA.DBF

 nTotal1 := 0
 nTotal2 := 0

 DEFINE DIALOG oDlg RESOURCE "INTEGFACT" TITLE 'Listado de Pólizas y Movimientos'
   REDEFINE XBROWSE oBrw ID 101 OF oDlg ;
            ALIAS (S12)->(ALIAS()) ;
            HEADERS "Tipo", "Número","Fecha","Concepto","Cargo","Abono","Fec Capt" ;
            FIELDS (S12)->A_TIPO,STR((S12)->A_NUMPOL),DTOC((S12)->A_FHAMOV),SUBS((S12)->A_CONCEP,1,35), ;
            TRANS((S12)->A_TOTCARG,"99,999,999.99"),TRANS((S12)->A_TOTCRED,"99,999,999.99"), ;
            DTOC((S12)->FECALTA) ;
            COLSIZES 30,45,52,180,80,80,52 ;
            JUSTIFY .T., .T., .T., .T., .T., .T.,.T.     // Esta parte no me justifica

            // Activa Footers
            oBrw:lFooter := .T.
            // Estilos de lineas
            oBrw:nColDividerStyle := LINESTYLE_BLACK
            *oBrw:nRowDividerStyle := LINESTYLE_BLACK
            oBrw:nMarqueeStyle    := MARQSTYLE_HIGHLCELL
            oBrw:lColDividerComplete := .T. // Completa pintado hasta el Footer cuando lineas no llenan todo ;
                                            // el Browse Headers Y Footers

            En esta parte, porque no me muestra o como hacerle , para que me totalice, o que instruccion me falta, tengo activado, lFooter := .F.

            *oCol:oBrw:= aCols[ 4 ]
            oCol:oBrw:cFooter := "Prueba Adriano"

 ACTIVATE DIALOG oDlg CENTERED // ON INIT Refresca(oBrw,oBrw2)

 (S13)->( OrdScope(0,nil) )
 (S13)->( OrdScope(0,nil) )

 oItem:Enable()

RETURN NIL
Last edited by ACC69 on Mon Aug 27, 2012 7:24 pm, edited 2 times in total.
ACC69
 
Posts: 632
Joined: Tue Dec 12, 2006 7:34 pm

Re: Problema con TXBrowse ,alguien me ayuda ?

Postby joseluisysturiz » Thu Aug 23, 2012 10:26 pm

Un ejemplo completo tipo factura, saludos... :shock:

REDEFINE xBrowse oBrw ID 100 of oFldx:aDialogs[1] ;
HEADERS "TM", "REFERENCIA", "FECHA", "COD.BANCO", "DESCRIPCION", "CONCEPTO", "TE", "MONTO", "ORI" ;
COLUMNS 1, 2, 3, 4, 5, 6, 7, 8, 9 ;
COLSIZES 50, 100, 100, 100, 200, 120, 50, 100, 50 ;
JUSTIFY AL_CENTER, AL_LEFT, AL_CENTER, AL_LEFT, AL_LEFT, AL_LEFT, AL_CENTER, AL_RIGHT, AL_CENTER ;
PICTURES , "@!", , "@!", "@!", , , "@E 9,999,999.99" ;
ARRAY aItems FASTEDIT LINES


// CONFIGURACION DEL xBROWSE
WITH OBJECT oBrw
:nMarqueeStyle := MARQSTYLE_HIGHLCELL
:nColDividerStyle := LINESTYLE_BLACK
:nStretchCol := STRETCHCOL_LAST
:bRClicked := { || msginfo( "pulsastes boton derecho..." ) } // LLAMA MENU-POPUP CON BOTON DERECHO
:lColDividerComplete := .t.
:nHeaderHeight := 30 // ANCHO CABEZERA
:l2007 := .t.
:lFooter := .t.
:lRecordSelector := .t. // SI/NO 1RA.COL.IZQ.QUE TIENE LA FLECHITA NEGRA
:lAllowColHiding := .f. // SI/NO BOTON DERECHO SOBRE CABEZERA, MUESTRE ARRAY COL.
:lAllowColSwapping := .f. // SI/NO INTERCAMBIAR COL.
:bClrStd := {|| IF( oBrw:nArrayAt % 2 == 0, {CLR_BLACK, CLR_WHITE}, {0, RGB(203, 226, 254)} ) }
:bKeyDown := {| nKey | teclado( nKey, oBrw, aVar, aGet, oQryBancos ) } // CONTROLA VIRTUAL KEY
***:bPastEof := { || addrow( oBrw ) } // HACE EDICION DE CELDA AUTOMATICAMENTE CON FLECHA ABAJO...
END WITH

// COLOR GRADIANTE EN XBROWSE...
/*
oBrw:bClrGrad := { | lInvert | IF( ! lInvert, ;
{ { 0.710,8388608,16777215 }, ;
{ 0.710,16777215,8388608 } }, ;
{ { 0.710,8388608,16777215 }, ;
{ 0.710,16777215,8388608 } } ) }

*/

// COL.1 - TIPO MOVIMIENTO(TM)
WITH OBJECT oBrw:aCols[1] // TIPO MOV.
:bStrData := {|| IIF( LEN( aItems ) = 0, SPACE(10) ,;
aItems[oBrw:nArrayAt, 1] ) }
:cToolTip := "Tipo Movimiento Ingreso/Egreso"
:nEditType := EDIT_LISTBOX
:aEditListTxt := aTipoMovi
* :aEditListBound :=
:bOnPostEdit := { | oCol, xVal, nKey | If( nKey <> VK_ESCAPE ,;
( oCol:value := xVal ), ) }
END WITH

WITH OBJECT oBrw:aCols[2] // REFERENCIA
:bStrData := {|| IIF( LEN( aItems ) = 0, SPACE(10) ,;
aItems[oBrw:nArrayAt, 2] ) }
:nEditType := EDIT_GET
:bEditWhen := {|| IF( EMPTY( aItems[oBrw:nArrayAt, 1] ), .f., .t. ) }
:bOnPostEdit := { | oCol, xVal, nKey | If( nKey <> VK_ESCAPE ,;
( oCol:value := xVal ), ) }
END WITH

WITH OBJECT oBrw:aCols[3] // FCH.MOV.
:bStrData := {|| IIF( LEN( aItems ) = 0, SPACE(10) ,;
aItems[oBrw:nArrayAt, 3] ) }
:nEditType := EDIT_GET
:bEditWhen := {|| IF( EMPTY( aItems[oBrw:nArrayAt, 1] ), .f., .t. ) }
:bOnPostEdit := { | oCol, xVal, nKey | If( nKey <> VK_ESCAPE ,;
( oCol:value := xVal ), ) }
END WITH

WITH OBJECT oBrw:aCols[4] // CODIGO CTA.BANCO
:bStrData := {|| IIF( LEN( aItems ) = 0, SPACE(10) ,;
aItems[oBrw:nArrayAt, 4] ) }
:nEditType := EDIT_GET_BUTTON
:bEditWhen := {|| IF( EMPTY( aItems[oBrw:nArrayAt, 1] ), .f., .t. ) }
:bOnPostEdit := { | oCol, xVal, nKey | If( nKey <> VK_ESCAPE ,;
( oCol:value := xVal ), ) }
END WITH .

WITH OBJECT oBrw:aCols[5] // DESCRIPCION MOV.
:bStrData := {|| IIF( LEN( aItems ) = 0, SPACE(10) ,;
aItems[oBrw:nArrayAt, 5] ) }
:nEditType := EDIT_GET
:bEditWhen := {|| IF( EMPTY( aItems[oBrw:nArrayAt, 1] ), .f., .t. ) }
:bOnPostEdit := { | oCol, xVal, nKey | If( nKey <> VK_ESCAPE ,;
( oCol:value := xVal ), ) }
END WITH .

WITH OBJECT oBrw:aCols[6] // CONCEPTOS(3 marias + otros)
:bStrData := {|| IIF( LEN( aItems ) = 0, SPACE(10) ,;
aItems[oBrw:nArrayAt, 6] ) }
:nEditType := EDIT_LISTBOX
:aEditListTxt := aConceptos
:bEditWhen := {|| IF( EMPTY( aItems[oBrw:nArrayAt, 1] ), .f., .t. ) }
:bOnPostEdit := { | oCol, xVal, nKey | If( nKey <> VK_ESCAPE ,;
( oCol:value := xVal ), ) } // avar := oBrw:aArrayData[oBrw:nAt, Columna]
END WITH

WITH OBJECT oBrw:aCols[7] // Tipo Operacion(Ingreso/Egreso).(debe/haber)
:bStrData := {|| IIF( LEN( aItems ) = 0, SPACE(10) ,;
aItems[oBrw:nArrayAt, 7] ) }
:cFooter := "Total->"
:cToolTip := "Tipo de Operacion"
:nEditType := EDIT_LISTBOX
:aEditListTxt := aTipoEI
*** :bEditWhen := {|| aItems[oBrw:nArrayAt, 1] == "I" } // ACTIVO SOLO SI ES Ingreso...
:bOnPostEdit := { | oCol, xVal, nKey | If( nKey <> VK_ESCAPE ,;
( oCol:value := xVal ), ) }
END WITH

// COL.8 - MONTO
WITH OBJECT oBrw:aCols[8]
:bStrData := {|| IIF( LEN( aItems ) = 0, SPACE(10) ,;
aItems[oBrw:nArrayAt, 8] ) }
:cEditPicture := "@E9,999,999.99"
:nFootStrAlign := AL_RIGHT
:lTotal := .t. // PARA TOTALIZAR COL.
:nTotal := 0 // PARA TOTALIZAR COL.
:nEditType := EDIT_GET
:bEditValid := { | oGet, oCol | mayorqcero( oGet:value() ) }
:bOnPostEdit := { | oCol, xVal, nKey | If( nKey <> VK_ESCAPE ,;
( oCol:value := xVal ,;
totalinea( oBrw, aVar, aGet ) ,;
graba_movbco( lNew, aVar, oDlg, oBrw, oQryBancos ) ,;
addrow( oBrw, oQryBancos, lNew ) ), ) }
:bEditWhen := {|| !EMPTY( aItems[oBrw:nArrayAt, 1] ) }
END WITH


WITH OBJECT oBrw:aCols[9] // ORIGEN DEL MOV.(cja,bco,vta,odp,com)
:bStrData := {|| IIF( LEN( aItems ) = 0, SPACE(10) ,;
aItems[oBrw:nArrayAt, 9] ) }
:cToolTip := "Origen del Movimiento"
END WITH

oBrw:MakeTotals()
oBrw:Refresh()
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: Problema con TXBrowse ,alguien me ayuda ?

Postby ACC69 » Fri Aug 24, 2012 2:02 pm

joseluisysturiz wrote:Un ejemplo completo tipo factura, saludos... :shock:

REDEFINE xBrowse oBrw ID 100 of oFldx:aDialogs[1] ;
HEADERS "TM", "REFERENCIA", "FECHA", "COD.BANCO", "DESCRIPCION", "CONCEPTO", "TE", "MONTO", "ORI" ;
COLUMNS 1, 2, 3, 4, 5, 6, 7, 8, 9 ;
COLSIZES 50, 100, 100, 100, 200, 120, 50, 100, 50 ;
JUSTIFY AL_CENTER, AL_LEFT, AL_CENTER, AL_LEFT, AL_LEFT, AL_LEFT, AL_CENTER, AL_RIGHT, AL_CENTER ;
PICTURES , "@!", , "@!", "@!", , , "@E 9,999,999.99" ;
ARRAY aItems FASTEDIT LINES


// CONFIGURACION DEL xBROWSE
WITH OBJECT oBrw
:nMarqueeStyle := MARQSTYLE_HIGHLCELL
:nColDividerStyle := LINESTYLE_BLACK
:nStretchCol := STRETCHCOL_LAST
:bRClicked := { || msginfo( "pulsastes boton derecho..." ) } // LLAMA MENU-POPUP CON BOTON DERECHO
:lColDividerComplete := .t.
:nHeaderHeight := 30 // ANCHO CABEZERA
:l2007 := .t.
:lFooter := .t.
:lRecordSelector := .t. // SI/NO 1RA.COL.IZQ.QUE TIENE LA FLECHITA NEGRA
:lAllowColHiding := .f. // SI/NO BOTON DERECHO SOBRE CABEZERA, MUESTRE ARRAY COL.
:lAllowColSwapping := .f. // SI/NO INTERCAMBIAR COL.
:bClrStd := {|| IF( oBrw:nArrayAt % 2 == 0, {CLR_BLACK, CLR_WHITE}, {0, RGB(203, 226, 254)} ) }
:bKeyDown := {| nKey | teclado( nKey, oBrw, aVar, aGet, oQryBancos ) } // CONTROLA VIRTUAL KEY
***:bPastEof := { || addrow( oBrw ) } // HACE EDICION DE CELDA AUTOMATICAMENTE CON FLECHA ABAJO...
END WITH

// COLOR GRADIANTE EN XBROWSE...
/*
oBrw:bClrGrad := { | lInvert | IF( ! lInvert, ;
{ { 0.710,8388608,16777215 }, ;
{ 0.710,16777215,8388608 } }, ;
{ { 0.710,8388608,16777215 }, ;
{ 0.710,16777215,8388608 } } ) }

*/

// COL.1 - TIPO MOVIMIENTO(TM)
WITH OBJECT oBrw:aCols[1] // TIPO MOV.
:bStrData := {|| IIF( LEN( aItems ) = 0, SPACE(10) ,;
aItems[oBrw:nArrayAt, 1] ) }
:cToolTip := "Tipo Movimiento Ingreso/Egreso"
:nEditType := EDIT_LISTBOX
:aEditListTxt := aTipoMovi
* :aEditListBound :=
:bOnPostEdit := { | oCol, xVal, nKey | If( nKey <> VK_ESCAPE ,;
( oCol:value := xVal ), ) }
END WITH

WITH OBJECT oBrw:aCols[2] // REFERENCIA
:bStrData := {|| IIF( LEN( aItems ) = 0, SPACE(10) ,;
aItems[oBrw:nArrayAt, 2] ) }
:nEditType := EDIT_GET
:bEditWhen := {|| IF( EMPTY( aItems[oBrw:nArrayAt, 1] ), .f., .t. ) }
:bOnPostEdit := { | oCol, xVal, nKey | If( nKey <> VK_ESCAPE ,;
( oCol:value := xVal ), ) }
END WITH

WITH OBJECT oBrw:aCols[3] // FCH.MOV.
:bStrData := {|| IIF( LEN( aItems ) = 0, SPACE(10) ,;
aItems[oBrw:nArrayAt, 3] ) }
:nEditType := EDIT_GET
:bEditWhen := {|| IF( EMPTY( aItems[oBrw:nArrayAt, 1] ), .f., .t. ) }
:bOnPostEdit := { | oCol, xVal, nKey | If( nKey <> VK_ESCAPE ,;
( oCol:value := xVal ), ) }
END WITH

WITH OBJECT oBrw:aCols[4] // CODIGO CTA.BANCO
:bStrData := {|| IIF( LEN( aItems ) = 0, SPACE(10) ,;
aItems[oBrw:nArrayAt, 4] ) }
:nEditType := EDIT_GET_BUTTON
:bEditWhen := {|| IF( EMPTY( aItems[oBrw:nArrayAt, 1] ), .f., .t. ) }
:bOnPostEdit := { | oCol, xVal, nKey | If( nKey <> VK_ESCAPE ,;
( oCol:value := xVal ), ) }
END WITH .

WITH OBJECT oBrw:aCols[5] // DESCRIPCION MOV.
:bStrData := {|| IIF( LEN( aItems ) = 0, SPACE(10) ,;
aItems[oBrw:nArrayAt, 5] ) }
:nEditType := EDIT_GET
:bEditWhen := {|| IF( EMPTY( aItems[oBrw:nArrayAt, 1] ), .f., .t. ) }
:bOnPostEdit := { | oCol, xVal, nKey | If( nKey <> VK_ESCAPE ,;
( oCol:value := xVal ), ) }
END WITH .

WITH OBJECT oBrw:aCols[6] // CONCEPTOS(3 marias + otros)
:bStrData := {|| IIF( LEN( aItems ) = 0, SPACE(10) ,;
aItems[oBrw:nArrayAt, 6] ) }
:nEditType := EDIT_LISTBOX
:aEditListTxt := aConceptos
:bEditWhen := {|| IF( EMPTY( aItems[oBrw:nArrayAt, 1] ), .f., .t. ) }
:bOnPostEdit := { | oCol, xVal, nKey | If( nKey <> VK_ESCAPE ,;
( oCol:value := xVal ), ) } // avar := oBrw:aArrayData[oBrw:nAt, Columna]
END WITH

WITH OBJECT oBrw:aCols[7] // Tipo Operacion(Ingreso/Egreso).(debe/haber)
:bStrData := {|| IIF( LEN( aItems ) = 0, SPACE(10) ,;
aItems[oBrw:nArrayAt, 7] ) }
:cFooter := "Total->"
:cToolTip := "Tipo de Operacion"
:nEditType := EDIT_LISTBOX
:aEditListTxt := aTipoEI
*** :bEditWhen := {|| aItems[oBrw:nArrayAt, 1] == "I" } // ACTIVO SOLO SI ES Ingreso...
:bOnPostEdit := { | oCol, xVal, nKey | If( nKey <> VK_ESCAPE ,;
( oCol:value := xVal ), ) }
END WITH

// COL.8 - MONTO
WITH OBJECT oBrw:aCols[8]
:bStrData := {|| IIF( LEN( aItems ) = 0, SPACE(10) ,;
aItems[oBrw:nArrayAt, 8] ) }
:cEditPicture := "@E9,999,999.99"
:nFootStrAlign := AL_RIGHT
:lTotal := .t. // PARA TOTALIZAR COL.
:nTotal := 0 // PARA TOTALIZAR COL.
:nEditType := EDIT_GET
:bEditValid := { | oGet, oCol | mayorqcero( oGet:value() ) }
:bOnPostEdit := { | oCol, xVal, nKey | If( nKey <> VK_ESCAPE ,;
( oCol:value := xVal ,;
totalinea( oBrw, aVar, aGet ) ,;
graba_movbco( lNew, aVar, oDlg, oBrw, oQryBancos ) ,;
addrow( oBrw, oQryBancos, lNew ) ), ) }
:bEditWhen := {|| !EMPTY( aItems[oBrw:nArrayAt, 1] ) }
END WITH


WITH OBJECT oBrw:aCols[9] // ORIGEN DEL MOV.(cja,bco,vta,odp,com)
:bStrData := {|| IIF( LEN( aItems ) = 0, SPACE(10) ,;
aItems[oBrw:nArrayAt, 9] ) }
:cToolTip := "Origen del Movimiento"
END WITH

oBrw:MakeTotals()
oBrw:Refresh()



Hola buenos dias , nuevamente gracias por tu rutina Jose Luis, lo adaptare a mi sistema, crei que era mas facil usar esta instruccion oBrw:bFooter := nImporte.....sin With Object.

Saludos y buen dia, luego le cuento como me quedo, gusto saludarte de nuevo Jose Luis.

Atte: Adrian C. C.
ACC69
 
Posts: 632
Joined: Tue Dec 12, 2006 7:34 pm

Re: Problema con TXBrowse ,alguien me ayuda ?

Postby joseluisysturiz » Fri Aug 24, 2012 3:58 pm

Saludos Adrian, es facil hacer lo que quieres, este xbrowse que te envie lo ves medio complicado por la forma en que lo manejo, pero solo queria darte un sample funcional para que vieras detalles, el with ....end es una forma de hacerlo, tambien puedes usar directo oBrw:tu_bloque o parametro, estamos a la orden como siempre, 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: Problema con TXBrowse ,alguien me ayuda ?

Postby ACC69 » Fri Aug 24, 2012 6:01 pm

joseluisysturiz wrote:Saludos Adrian, es facil hacer lo que quieres, este xbrowse que te envie lo ves medio complicado por la forma en que lo manejo, pero solo queria darte un sample funcional para que vieras detalles, el with ....end es una forma de hacerlo, tambien puedes usar directo oBrw:tu_bloque o parametro, estamos a la orden como siempre, saludos... :shock:


Hola Luis, aqui de nuevo, y perdona que te este molestando o alguien mas que me pueda ayudar con ese detalle, que no me refresca los totales de cargo y abono, en segundo Browse , adjunto codigo, pantalla no recuerdo como anexarle.
Tengo la variable :

oBrw2:aCols[6]:nTotal := Trans( aSum[1,2],"99,999,999.99") // Total Cargo

Si le pongo asi :
oBrw2:aCols[6]:bFooter := Trans( aSum[1,2],"99,999,999.99") // Total Cargo marca de error al ejecutar...



Code: Select all  Expand view  RUN
#Include "FiveWin.ch"
#Include "xBrowse.ch"

 *+CRLF+"Póliza"

STATIC oDlg,oBrw2
STATIC S12, S13
STATIC nTCarg,nTCred,aSum

MemVar oWnd, oMOpc, nNumEmp, cDescrEmp, Mes_Per, Ano_Per, nStation

//------------------------------------------------------------------------------
FUNCTION MOD_PBAS()
 LOCAL oItem:=oMOpc,oBrw

 S12 := Abre_Dbf(12,12) // Abre: POLZxMxA.DBF
 S13 := Abre_Dbf(13,13) // Abre: MOVTxMxA.DBF

 nTCarg := 0
 nTCred := 0


 TotCarAbo(@nTCarg,@nTCred)

 Refr_MovPol()

 DEFINE DIALOG oDlg RESOURCE "INTEGFACT" TITLE 'Listado de Pólizas y Movimientos'
   REDEFINE XBROWSE oBrw ID 101 OF oDlg ;
            ALIAS (S12)->(ALIAS()) ;
            HEADERS "Tipo", "Número","Fecha","Concepto","Cargo","Abono","Fec Capt" ;
            FIELDS (S12)->A_TIPO,STR((S12)->A_NUMPOL),DTOC((S12)->A_FHAMOV),SUBS((S12)->A_CONCEP,1,35), ;
            TRANS((S12)->A_TOTCARG,"99,999,999.99"),TRANS((S12)->A_TOTCRED,"99,999,999.99"), ;
            DTOC((S12)->FECALTA) ;
            COLSIZES 30,45,52,180,80,80,52 ;
            JUSTIFY .F., .T., .F., .F., .T., .T.,.T.

            // CONFIGURACION DEL xBROWSE
            // Activa Footers
            oBrw:lFooter := .T.
            // Estilos de lineas
            oBrw:nColDividerStyle := LINESTYLE_BLACK
            *oBrw:nRowDividerStyle := LINESTYLE_BLACK
            oBrw:nMarqueeStyle    := MARQSTYLE_HIGHLCELL
            oBrw:lColDividerComplete := .T. // Completa pintado hasta el Footer cuando lineas no llenan todo ;
                                            // el Browse Headers Y Footers

            oBrw:bChange:= { || Refr_MovDet(oBrw2) }

            oBrw:aCols[3]:nHeadStrAlign:= AL_CENTER
            oBrw:aCols[4]:nHeadStrAlign:= AL_CENTER
            oBrw:aCols[5]:nHeadStrAlign:= AL_CENTER
            oBrw:aCols[5]:nFootStrAlign := 1
            oBrw:aCols[5]:lTotal := .T. // PARA TOTALIZAR COL.
            oBrw:aCols[5]:nTotal := TRANS(nTCarg,"99,999,999.99") // PARA TOTALIZAR COL.
            oBrw:aCols[6]:nHeadStrAlign:= AL_CENTER
            oBrw:aCols[6]:nFootStrAlign := 1
            oBrw:aCols[6]:nTotal := TRANS(nTCred,"99,999,999.99") // PARA TOTALIZAR COL.

            oDlg:bStart := { || oBrw:Setfocus(),oBrw:Refresh() }

     // Detalle de movimientos, no me refresca los totales o es la variable nTotal ,si le pongo bFooter, no reconoce marca error
     REDEFINE XBROWSE oBrw2 ID 102 OF oDlg ;
            ALIAS (S13)->(ALIAS()) ;
            HEADERS "Cuentas", "Segm","Fecha","Refer.","Concepto","Cargo","Abono" ;
            FIELDS EXT_xNIV((S13)->MV_NCTA),STR((S13)->SEGNEG),DTOC( (S13)->MV_FHAM ),(S13)->MV_REFE, ;
            SUBS((S13)->MV_CONC,1,35), TRANS( (S13)->MV_CARG,"99,999,999.99"),TRANS( (S13)->MV_ABON,"99,999,999.99") ;
            COLSIZES 112,35,52,85,180,80,80 ;
            JUSTIFY .F., AL_CENTER, .F., .F., ,.F.,.T., .T.

            // Activa Footers
            oBrw2:lFooter := .T.
            // Estilos de lineas
            oBrw2:nColDividerStyle := LINESTYLE_BLACK
            *oBrw2:nRowDividerStyle := LINESTYLE_BLACK
            oBrw2:nMarqueeStyle    := MARQSTYLE_HIGHLCELL
            oBrw2:lColDividerComplete := .T. // Completa pintado hasta el Footer cuando lineas no llenan todo ;
                                            // el Browse Headers Y Footers

            oBrw2:aCols[1]:nHeadStrAlign:= AL_CENTER
            oBrw2:aCols[3]:nHeadStrAlign:= AL_CENTER
            oBrw2:aCols[5]:nHeadStrAlign:= AL_CENTER
            oBrw2:aCols[6]:nHeadStrAlign:= AL_CENTER
            oBrw2:aCols[6]:nFootStrAlign := 1
            oBrw2:aCols[6]:nTotal := Trans( aSum[1,2],"99,999,999.99") // Total Cargo    Esta parte no me refresca total
            oBrw2:aCols[7]:nHeadStrAlign:= AL_CENTER
            oBrw2:aCols[7]:nFootStrAlign := 1
            oBrw2:aCols[7]:nTotal := Trans( aSum[1,3],"99,999,999.99") // Total Credito Esta parte no me refresca total

 ACTIVATE DIALOG oDlg CENTERED ON INIT Refresca(oBrw,oBrw2)

 (S13)->( OrdScope(0,nil) )
 (S13)->( OrdScope(0,nil) )

 oItem:Enable()

RETURN NIL

//------------------------------------------------------------------------------
STATIC FUNCTION Refr_MovDet(oBrw2)
 (S13)->(OrdScope( 0,(S12)->A_TIPO+STR((S12)->A_NUMPOL,5) ))
 (S13)->(OrdScope( 1,(S12)->A_TIPO+STR((S12)->A_NUMPOL,5) ))

 (S13)->(DbGoTop())

 Refr_MovPol()

 oBrw2:Refresh()
RETURN ( oBrw2 )

//------------------------------------------------------------------------------
STATIC FUNCTION Refr_MovPol()
 aSum := {{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}}

 (S13)->(DbSeek((S12)->A_TIPO+STR((S12)->A_NUMPOL,5)))

 DO WHILE (S13)->MV_TIPO = (S12)->A_TIPO .AND. (S13)->MV_NUMP = (S12)->A_NUMPOL .AND. (S13)->(!EOF())
     aSum[1, 1] := aSum[1,1] + 1 // Num de movimientos de partidas
     aSum[1, 2] += (S13)->MV_CARG
     aSum[1, 3] += (S13)->MV_ABON

     IF (S13)->TIPOMOV == "C"
         aSum[1, 4] += (S13)->IMPBS1
         aSum[1, 5] += (S13)->IVA_1
         aSum[1, 6] += (S13)->IMPBS2
         aSum[1, 7] += (S13)->IVA_2
         aSum[1, 8] += (S13)->T_0
         aSum[1, 9] += (S13)->T_EXENT
         aSum[1,10] += (S13)->OTROS
         aSum[1,11] += (S13)->IMPBS3
         aSum[1,12] += (S13)->T_Otras
         aSum[1,13] += (S13)->RET_IVA
         aSum[1,14] += (S13)->RET_ISR
     ENDIF

     (S13)->(DbSkip())

     SysRefresh()
 ENDDO

 MsgInfo(aSum[1, 2])
 MsgInfo(aSum[1, 3])

 (S13)->(DbGoTop())
 (S13)->(DbSeek((S12)->A_TIPO+STR((S12)->A_NUMPOL,5)))
Return NIL

//------------------------------------------------------------------------------
STATIC FUNCTION Refresca(oBrw,oBrw2)
 (S13)->(OrdScope( 0,(S12)->A_TIPO+STR((S12)->A_NUMPOL,5) ))
 (S13)->(OrdScope( 1,(S12)->A_TIPO+STR((S12)->A_NUMPOL,5) ))

 (S13)->(DbGoTop())

 // Luego lo checo!
 *oBrw2:GoTop()
 *oBrw2:refresh()

 oBrw:SetFocus()
 oBrw2:SetFocus()

 oBrw:Refresh()
 oBrw2:Refresh()
RETURN Nil


Espero que alguien mas me pueda echar la mano, en la parte de Detalle, en oBrw2

Saludos y buen dia.
ACC69
 
Posts: 632
Joined: Tue Dec 12, 2006 7:34 pm

Re: No refresca totales con TXBrowse ,alguien me ayuda ?

Postby FranciscoA » Sat Aug 25, 2012 1:44 am

Hola ACC69, aquí te pongo algunas lineas de código, que espero te auxilien.

oBrw1 := TXBrowse():New( oDlg )
oBrw1:cAlias:=(cAlias1)

//COLUMNAS DEL BROWSE
oCol1 = oBrw1:AddCol()
oCol1:bStrData = { || (cWork1)->CodiCont }
oCol1:nDataStrAlign := 0
oCol1:cHeader = "Codigo"+CRLF+"Contable"
oCol1:nWidth = 120

oCol1 = oBrw1:AddCol()
oCol1:bStrData = { || (cWork1)->Nombre }
oCol1:cHeader = "Nombre de la Cuenta"
oCol1:nWidth = 350

oBrw1:CreateFromResource(180)
oBrw1:SetRDD()

oBrw1:bChange:={|| Saldos(cAlias2,cAlias1), oBrw2:MakeTotals(), oBrw2:Refresh() } //esta funct es la que filtra el oBrw2, segun seleccion en el oBrw1


//******* BROWSE NUMERO DOS ******
oBrw2 := TXBrowse():New( oDlg )
oBrw2:cAlias:=(cAlias2)

oCol2 = oBrw2:AddCol()
oCol2:bEditValue = { || (cWork2)->Fechemis }
oCol2:nEditType = 0 //no editable
oCol2:cHeader = "Fecha"+CRLF+"Transacc"
oCol2:nWidth = 80

oCol2 = oBrw2:AddCol()
oCol2:bEditValue = { || (cWork2)->Concepto }
oCol2:nEditType = 0 //no editable
oCol2:cHeader = "Concepto de"+CRLF+"Afectación"
oCol2:nWidth = 400

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

oBrw2:CreateFromResource(181)
oBrw2:SetRDD()

Saludos.
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh-MySql-TMySql
User avatar
FranciscoA
 
Posts: 2159
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: No refresca totales con TXBrowse ,alguien me ayuda ?

Postby ACC69 » Mon Aug 27, 2012 7:24 pm

FranciscoA wrote:Hola ACC69, aquí te pongo algunas lineas de código, que espero te auxilien.

oBrw1 := TXBrowse():New( oDlg )
oBrw1:cAlias:=(cAlias1)

//COLUMNAS DEL BROWSE
oCol1 = oBrw1:AddCol()
oCol1:bStrData = { || (cWork1)->CodiCont }
oCol1:nDataStrAlign := 0
oCol1:cHeader = "Codigo"+CRLF+"Contable"
oCol1:nWidth = 120

oCol1 = oBrw1:AddCol()
oCol1:bStrData = { || (cWork1)->Nombre }
oCol1:cHeader = "Nombre de la Cuenta"
oCol1:nWidth = 350

oBrw1:CreateFromResource(180)
oBrw1:SetRDD()

oBrw1:bChange:={|| Saldos(cAlias2,cAlias1), oBrw2:MakeTotals(), oBrw2:Refresh() } //esta funct es la que filtra el oBrw2, segun seleccion en el oBrw1


//******* BROWSE NUMERO DOS ******
oBrw2 := TXBrowse():New( oDlg )
oBrw2:cAlias:=(cAlias2)

oCol2 = oBrw2:AddCol()
oCol2:bEditValue = { || (cWork2)->Fechemis }
oCol2:nEditType = 0 //no editable
oCol2:cHeader = "Fecha"+CRLF+"Transacc"
oCol2:nWidth = 80

oCol2 = oBrw2:AddCol()
oCol2:bEditValue = { || (cWork2)->Concepto }
oCol2:nEditType = 0 //no editable
oCol2:cHeader = "Concepto de"+CRLF+"Afectación"
oCol2:nWidth = 400

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

oBrw2:CreateFromResource(181)
oBrw2:SetRDD()

Saludos.


Hola buenas tardes , aqui de nuevo, y gracias Francisco, aunque no es la manera correcta, pero solo asi de esa manera me refresca los totales , la tuve que solucionar dentro de la funcion, aunque repito, no es l manera correcta, creo que es un bug, que viene en la clase de TXBrowse, que no refresca bien los totales, codificandolo de esta manera, con Redefine XBrowse

Code: Select all  Expand view  RUN
#Include "FiveWin.ch"
#Include "xBrowse.ch"

 *+CRLF+"Póliza"

STATIC oDlg,oBrw2
STATIC S12, S13
STATIC nTCarg,nTCred,aSum

MemVar oWnd, oMOpc, nNumEmp, cDescrEmp, Mes_Per, Ano_Per, nStation

//------------------------------------------------------------------------------
FUNCTION MOD_PBAS()
 LOCAL oItem:=oMOpc,oBrw

 S12 := Abre_Dbf(12,12) // Abre: POLZxMxA.DBF
 S13 := Abre_Dbf(13,13) // Abre: MOVTxMxA.DBF

 nTCarg := 0
 nTCred := 0

 *TotCarAbo(@nTCarg,@nTCred)
 Refr_MovPol()

 DEFINE DIALOG oDlg RESOURCE "INTEGFACT" TITLE 'Listado de Pólizas y Movimientos'
   REDEFINE XBROWSE oBrw ID 101 OF oDlg ;
            ALIAS (S12)->(ALIAS()) ;
            HEADERS "Tipo", "Número","Fecha","Concepto","Cargo","Abono","Fec Capt" ;
            FIELDS (S12)->A_TIPO,STR((S12)->A_NUMPOL),DTOC((S12)->A_FHAMOV),SUBS((S12)->A_CONCEP,1,35), ;
            TRANS((S12)->A_TOTCARG,"99,999,999.99"),TRANS((S12)->A_TOTCRED,"99,999,999.99"), ;
            DTOC((S12)->FECALTA) ;
            COLSIZES 30,45,52,180,80,80,52 ;
            JUSTIFY .F., .T., .F., .F., .T., .T.,.T.

            // CONFIGURACION DEL xBROWSE
            // Activa Footers
            oBrw:lFooter := .T.
            // Estilos de lineas
            oBrw:nColDividerStyle := LINESTYLE_BLACK
            *oBrw:nRowDividerStyle := LINESTYLE_BLACK
            oBrw:nMarqueeStyle    := MARQSTYLE_HIGHLCELL
            oBrw:lColDividerComplete := .T. // Completa pintado hasta el Footer cuando lineas no llenan todo ;
                                            // el Browse Headers Y Footers

            oBrw:bChange:= { || Refr_MovDet() }

            oBrw:aCols[3]:nHeadStrAlign:= AL_CENTER
            oBrw:aCols[4]:nHeadStrAlign:= AL_CENTER
            oBrw:aCols[5]:nHeadStrAlign:= AL_CENTER
            oBrw:aCols[5]:nFootStrAlign := 1
            oBrw:aCols[5]:nTotal := 0 // TRANS(nTCarg,"99,999,999.99") // PARA TOTALIZAR COL.
            oBrw:aCols[6]:nHeadStrAlign:= AL_CENTER
            oBrw:aCols[6]:nFootStrAlign := 1
            oBrw:aCols[6]:nTotal := TRANS(nTCred,"99,999,999.99") // PARA TOTALIZAR COL.

            oDlg:bStart := { || oBrw:Setfocus(),oBrw:Refresh() }

   REDEFINE XBROWSE oBrw2 ID 102 OF oDlg ;
            ALIAS (S13)->(ALIAS()) ;
            HEADERS "Cuentas", "Segm","Fecha","Refer.","Concepto","Cargo","Abono" ;
            FIELDS EXT_xNIV((S13)->MV_NCTA),STR((S13)->SEGNEG),DTOC( (S13)->MV_FHAM ),(S13)->MV_REFE, ;
            SUBS((S13)->MV_CONC,1,35), TRANS( (S13)->MV_CARG,"99,999,999.99"),TRANS( (S13)->MV_ABON,"99,999,999.99") ;
            COLSIZES 112,35,52,85,180,80,80 ;
            JUSTIFY .F., AL_CENTER, .F., .F., ,.F.,.T., .T.

            // Activa Footers
            oBrw2:lFooter := .T.
            // Estilos de lineas
            oBrw2:nColDividerStyle := LINESTYLE_BLACK
            *oBrw2:nRowDividerStyle := LINESTYLE_BLACK
            oBrw2:nMarqueeStyle    := MARQSTYLE_HIGHLCELL
            oBrw2:lColDividerComplete := .T. // Completa pintado hasta el Footer cuando lineas no llenan todo ;
                                            // el Browse Headers Y Footers

            oBrw2:aCols[1]:nHeadStrAlign:= AL_CENTER
            oBrw2:aCols[3]:nHeadStrAlign:= AL_CENTER
            oBrw2:aCols[5]:nHeadStrAlign:= AL_CENTER
            oBrw2:aCols[6]:nHeadStrAlign:= AL_CENTER
            oBrw2:aCols[6]:nFootStrAlign := 1

       // Esta parte de aqui, no me refresca
         *   oBrw2:aCols[6]:lTotal := .T. // PARA TOTALIZAR COL.
         *   oBrw2:aCols[6]:nTotal := Trans( aSum[1,2],"99,999,999.99") // Total Cargo
         *   oBrw2:aCols[7]:nHeadStrAlign:= AL_CENTER
         *   oBrw2:aCols[7]:nFootStrAlign := 1
         *   oBrw2:aCols[7]:nTotal := Trans( aSum[1,3],"99,999,999.99") // Total Credito

 ACTIVATE DIALOG oDlg CENTERED ON INIT Refresca(oBrw,oBrw2)

 (S13)->( OrdScope(0,nil) )
 (S13)->( OrdScope(0,nil) )

 oItem:Enable()

RETURN NIL


Y aqui si me refresca los totales, dentro de la funcion:
Code: Select all  Expand view  RUN
//------------------------------------------------------------------------------
STATIC FUNCTION Refr_MovDet()
 (S13)->(OrdScope( 0,(S12)->A_TIPO+STR((S12)->A_NUMPOL,5) ))
 (S13)->(OrdScope( 1,(S12)->A_TIPO+STR((S12)->A_NUMPOL,5) ))

 (S13)->(DbGoTop())

 Refr_MovPol()

 [b]// Aqui si me refresca,los importes totales a detalle[/b]

 oBrw2:aCols[1]:nHeadStrAlign:= AL_CENTER
 oBrw2:aCols[1]:nTotal := STR(aSum[1,1])+" Mov(s)"          // Num de Movimientos
 oBrw2:aCols[6]:nTotal := Trans( aSum[1,2],"99,999,999.99") // Total Cargo
 oBrw2:aCols[7]:nHeadStrAlign:= AL_CENTER
 oBrw2:aCols[7]:nFootStrAlign := 1
 oBrw2:aCols[7]:nTotal := Trans( aSum[1,3],"99,999,999.99") // Total Credito

 oBrw2:Refresh()
RETURN NIL

//------------------------------------------------------------------------------
STATIC FUNCTION TotCarAbo(nTCarg,nTCred)
 (S13)->(DbEval({|| nTCarg+=(S13)->MV_CARG},,,,,.f.))
 (S13)->(DbEval({|| nTCred+=(S13)->MV_ABON},,,,,.f.))

 SysRefresh()
RETURN NIL

//------------------------------------------------------------------------------
STATIC FUNCTION Refr_MovPol()
 aSum := {{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}}

 (S13)->(DbSeek((S12)->A_TIPO+STR((S12)->A_NUMPOL,5)))

 DO WHILE (S13)->MV_TIPO = (S12)->A_TIPO .AND. (S13)->MV_NUMP = (S12)->A_NUMPOL .AND. (S13)->(!EOF())
     aSum[1, 1] := aSum[1,1] + 1 // Num de movimientos de partidas
     aSum[1, 2] += (S13)->MV_CARG
     aSum[1, 3] += (S13)->MV_ABON

     IF (S13)->TIPOMOV == "C"
         aSum[1, 4] += (S13)->IMPBS1
         aSum[1, 5] += (S13)->IVA_1
         aSum[1, 6] += (S13)->IMPBS2
         aSum[1, 7] += (S13)->IVA_2
         aSum[1, 8] += (S13)->T_0
         aSum[1, 9] += (S13)->T_EXENT
         aSum[1,10] += (S13)->OTROS
         aSum[1,11] += (S13)->IMPBS3
         aSum[1,12] += (S13)->T_Otras
         aSum[1,13] += (S13)->RET_IVA
         aSum[1,14] += (S13)->RET_ISR
     ENDIF

     (S13)->(DbSkip())

     SysRefresh()
 ENDDO

 *MsgInfo(aSum[1, 2])
 *MsgInfo(aSum[1, 3])

 (S13)->(DbGoTop())
 (S13)->(DbSeek((S12)->A_TIPO+STR((S12)->A_NUMPOL,5)))
Return NIL


Nuevamente gracias Francisco, saludos y buen dia.

Atte: Adrian C. C.
ACC69
 
Posts: 632
Joined: Tue Dec 12, 2006 7:34 pm

Re: No refresca totales con TXBrowse ,Solucionado!!?

Postby nageswaragunupudi » Tue Aug 28, 2012 1:56 pm

In XBrowse, justification and formatting are automatic. Please do not use FIELDS clause. Instead use COLUMNS clause and DO NOT format them with TRANSFORM or DTOC.

XBrowse examines the column names and finds out automatically if the field types and provides formatting automatically. By default, XBrowse right justifies numbers and dates and other types left. Also calculates the column sizes to fit the data snugly.

We need to provide formatting or column sizes only if we find special need to override the default behavior.

At the beginning the the project, call a function
XBrNumFormat( "E", .t.) // E for European Formatting and A for American. .T. for using thousand separators.

Here is the way to code your sample you posted.
Code: Select all  Expand view  RUN
  XbrNumFormat( "E", .t. )

   REDEFINE XBROWSE oBrw ID 101 OF oDlg ;
            ALIAS (S12)->(ALIAS()) ;
            HEADERS "Tipo", "Número","Fecha","Concepto","Cargo","Abono","Fec Capt" ;
            COLUMNS "A_TIPO", "A_NUMPOL", "A_FHAMOV", "LEFT(A_CONCEP,35)", ;
               "A_TOTCARG", "A_TOTCRED", "F_ECALTA" ;
            CELL LINES FOOTERS NOBORDER
           
            oBrw:Concepto:cFooter      := "Prueba Adriano"
            oBrw:aCols[ 5 ]:nFooterType := AGGR_SUM
            oBrw:aCols[ 6 ]:nFooterType := AGGR_SUM
            oBrw:MakeTotals()
           
            ACTIVATE DIALOG oDlg CENTERED
 


The numbers and dates are formatted automatically and the columns are justified as the user expects.

XBrowse also helps you by automatically totalling and displaying them in the footers.

Please try the above code.
Note: I hope you are not using a very very old version of FWH.
Regards

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

Re: No refresca totales con TXBrowse ,Solucionado!!?

Postby nageswaragunupudi » Tue Aug 28, 2012 2:25 pm

Here is a sample using \fwh\samples\customer.dbf.
Shows automatic formatting, auto alignment and auto totals. Not only simple totals, xBrowse can help us to calculate Averages, Standard Deviations, etc. without our having to do the calculations.

Code: Select all  Expand view  RUN
#include "FiveWin.Ch"
#include "ord.ch"
#include "xbrowse.ch"
#include "hbcompat.ch"

REQUEST DBFCDX

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

function Main()

   local oDlg, oBrw, oFont

   SET DATE ITALIAN
   SET CENTURY ON

   XBrNumFormat( 'E', .t. )

   USE C:\FWH\SAMPLES\CUSTOMER.DBF NEW ALIAS CUST VIA "DBFCDX"

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
   DEFINE DIALOG oDlg SIZE 750,400 PIXEL FONT oFont
   @ 10,10 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg ;
      ALIAS "CUST" ;
      COLUMNS "First", "City", "HireDate", "Age", "Salary" ;
      CELL LINES FOOTERS NOBORDER

   WITH OBJECT oBrw
      :nStretchCol         := 1
      :First:cFooter       := "Aggregates"
      :Age:nFooterType     := AGGR_AVG
      :Salary:nFooterType  := AGGR_SUM
      :MakeTotals()
      //
      :CreateFromCode()  // omit for resource
   END

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont
   CLOSE DATA

return nil

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


Screenshot

Image
Regards

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

Re: No refresca totales con TXBrowse ,Solucionado!!?

Postby ACC69 » Tue Aug 28, 2012 4:14 pm

nageswaragunupudi wrote:In XBrowse, justification and formatting are automatic. Please do not use FIELDS clause. Instead use COLUMNS clause and DO NOT format them with TRANSFORM or DTOC.

XBrowse examines the column names and finds out automatically if the field types and provides formatting automatically. By default, XBrowse right justifies numbers and dates and other types left. Also calculates the column sizes to fit the data snugly.

We need to provide formatting or column sizes only if we find special need to override the default behavior.

At the beginning the the project, call a function
XBrNumFormat( "E", .t.) // E for European Formatting and A for American. .T. for using thousand separators.

Here is the way to code your sample you posted.
Code: Select all  Expand view  RUN
  XbrNumFormat( "E", .t. )

   REDEFINE XBROWSE oBrw ID 101 OF oDlg ;
            ALIAS (S12)->(ALIAS()) ;
            HEADERS "Tipo", "Número","Fecha","Concepto","Cargo","Abono","Fec Capt" ;
            COLUMNS "A_TIPO", "A_NUMPOL", "A_FHAMOV", "LEFT(A_CONCEP,35)", ;
               "A_TOTCARG", "A_TOTCRED", "F_ECALTA" ;
            CELL LINES FOOTERS NOBORDER
           
            oBrw:Concepto:cFooter      := "Prueba Adriano"
            oBrw:aCols[ 5 ]:nFooterType := AGGR_SUM
            oBrw:aCols[ 6 ]:nFooterType := AGGR_SUM
            oBrw:MakeTotals()
           
            ACTIVATE DIALOG oDlg CENTERED
 


The numbers and dates are formatted automatically and the columns are justified as the user expects.

XBrowse also helps you by automatically totalling and displaying them in the footers.

Please try the above code.
Note: I hope you are not using a very very old version of FWH.



Hola buenos dias Rao, gracias por el detalle y sugerencias,de TXBrowse con recurso, ahora mi version, no es actual, tengo la version 8.12 y no esta implementado las variables en esa version que tengo actualmente es muy viejo la 8.12.

AGGR_SUM ...ETC ETC ETC, no esta implementado en mi version antiguo la 8.12

oBrw:Concepto:cFooter      := "Prueba Adriano"
            oBrw:aCols[ 5 ]:nFooterType := AGGR_SUM
            oBrw:aCols[ 6 ]:nFooterType := AGGR_SUM
            oBrw:MakeTotals()
.

De todas maneras nuevamente gracias por tu interes Ingeniero Rao,pero por el momento de esa manera me refresca los totales, desde el maestro a los detalles, que me refresca los totales, de cada movimiento maestro. Aun soy novato en la clase TXBrowse, pero con el tiempo me ire familiarizando, y se , que en algunas cosas, tendre problemillas, que luego preguntare al foro, y que espero me puedan echarme la mano y su ayuda.

Gracias de nuevo y aludos cordiales Rao.

Atte: Adrian C. C.
ACC69
 
Posts: 632
Joined: Tue Dec 12, 2006 7:34 pm

Re: No refresca totales con TXBrowse ,Solucionado!!?

Postby StefanHaupt » Wed Aug 29, 2012 7:04 am

Nages,

nageswaragunupudi wrote:In XBrowse, justification and formatting are automatic. Please do not use FIELDS clause. Instead use COLUMNS clause and DO NOT format them with TRANSFORM or DTOC.


What is the difference between FILEDS and COLUMNS ?
kind regards
Stefan
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Re: No refresca totales con TXBrowse ,Solucionado!!?

Postby nageswaragunupudi » Wed Aug 29, 2012 6:39 pm

Mr. Adrian
Excepting auto totals, all other features in my sample work in version 8.12 also.

Mr. Stefan

FIELDS clause was kept to help easy migration from WBrowse. With minor changes, the command @ r,c LISTBOX ... FIELDS command can be converted to work with XBrowse.

The values in the list in FIELDS clause are passed to the XBrowse as codeblocks. Therefore XBrowse can only blindly display results by evaluating the codeblocks.

When we use COLUMNS clause, we list the names of the fields to browse. Example COLUMNS "First", "Last", "Age". "Salary". etc. XBrowse examines the fields in the DBF and

(A) learns the field type ( C,N,L,M,D,T ), field len, feild dec and decides the appropriate (1) alignment, (2) picture clause and (3) column width. There is no need for the programmer to specify a picture clause or use DTOC(..) or Transform( ...) etc.

(B) Decides Headers to us, unless overridden.

(C) Additionally, XBrowse also examines all the index orders and index expressions of the CDX and decides which Index TAG is to be used to auto sorting the column when the header is clicked.

(D) Automatically generate appropriate codeblocks for saving the data in the DBF, including locking (in case of shared files) and keeps ready for inline editing. If the programmer enables editing by one simple code "oCol:nEditType := EDIT_???", xbrowse provides inline editing and handles rest of the work of locking saving data, etc automatically.

(E) Decides what columns are fit for aggregation. And many more.

This feature works the same way whether it is DBF. TDatabase. Ado RecordSet or TDolphin.

In recent versions, we can intemix codeblocks or expressions in the COLUMNS clause.

For example, we can write:

COLUMNS { || oBrw:KeyNo() }, "FIRST - ". " + LAST", "Quantity", "Price", "Quantity * Price"

So, using COLUMNS clause, we can avoid writing pages of code, which we need to write for other browses to achieve the above and we are assured of bug-free performance.

I recommend taking full advantage of the built-in features of XBrowse.
Regards

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

Re: No refresca totales con TXBrowse ,Solucionado!!?

Postby StefanHaupt » Thu Aug 30, 2012 6:59 am

thanks for your detailed explanation :D
kind regards
Stefan
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Re: No refresca totales con TXBrowse ,Solucionado!!?

Postby devtuxtla » Thu Aug 30, 2012 3:32 pm

Hi nages

where I find all documentation xBrowse?
One of the problems I have to migrate TXBrowse, is that I can not find how to use it properly.

thanks

regards
Visite Chiapas, el paraiso de México.
devtuxtla
 
Posts: 392
Joined: Tue Jul 29, 2008 1:55 pm

Re: No refresca totales con TXBrowse ,Solucionado!!?

Postby nageswaragunupudi » Fri Aug 31, 2012 1:19 am

Sources:
1. FiveWiki
2. Whatsnew.txt
3. samples in fwh\samples folder. In particular please see testxbr3.prg
4. These forums.
Regards

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

Next

Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 106 guests