Would you help us?
This is my code
- Code: Select all Expand view RUN
REDEFINE XBROWSE oBrw ID 200 OF oDlg;
DATASOURCE oRsDsl ;
COLUMNS "DIE_FOL", "DIE_FDM", "DIE_REF", "", "","DIE_IMP","UNI_DES","OPE_NOM","DIE_DES", "DIE_CAN";
HEADERS "Folio", "Fecha", "Referencia", "Compras", "Consumos","Importe","Unidad","Operador", "Destino(s)", "Can";
COLSIZES 60, 75, 90, 65, 65, 80, 200, 220,230, 40, 40;
PICTURES "@Z 9999999","dd/mmm/yyyy", NIL, "@Z 999,999", "@Z 999,999","@Z 9,999,999.99", NIL, NIL,NIL, NIL;
JUSTIFY { AL_RIGHT, AL_RIGHT, AL_LEFT, AL_RIGHT, AL_RIGHT,AL_RIGHT, AL_LEFT, AL_LEFT, AL_LEFT, AL_CENTER };
FOOTERS AUTOSORT BACKGROUND "Lineas"
WITH OBJECT oBrw
:l2007 := ( .F. )
:lHScroll := ( .F. )
:lVScroll := ( .F. )
:nMarqueeStyle := MARQSTYLE_HIGHLROW
:nColDividerStyle := LINESTYLE_LIGHTGRAY
:nRowDividerStyle := LINESTYLE_LIGHTGRAY
:nStretchCol := STRETCHCOL_LAST
:SetGroupHeader( "L I T R O S", 04, 05 )
:nHeaderHeight := 25
:nRowHeight := 22
:nFooterHeight := 25
:bClrHeader := {|| { CLR_WHITE,CLR_BLACK } }
:bClrFooter := {|| { CLR_WHITE,CLR_BLACK } }
:bClrSel := {|| IF( oBrw:KeyNo % oApp:nRowsInt == 0,{ CLR_BLACK, oApp:nRowParClr }, { CLR_BLACK, oApp:nRowNonClr } ) }
:bClrSelFocus := {|| { oApp:nFClrFocus,oApp:nBClrFocus } }
:bClrStd := {|| IF( oBrw:KeyNo % oApp:nRowsInt == 0,{ CLR_BLACK, oApp:nRowParClr }, { CLR_BLACK, oApp:nRowNonClr } ) }
:nRecSelColor := oApp:nRowParClr
:lDisplayZeros := ( .F. ) // zero values are not displayed. Added by GNRao. No need to use @Z
// Por fuerza debe ir dentro del WITH OBJECT oBrw
WITH OBJECT :aCols[ 01 ]
:cOrder := "A"
END
WITH OBJECT :aCols[ 04 ]
:bStrData := {|| IF( oRsDsl:RecordCount() > 0 .AND. ;
oRsDsl:Fields( "DIE_EOS" ):Value == "E", ;
Transform( oRsDsl:Fields( "DIE_LTS" ):Value, "@Z 9,999,999" ), Space( 01 ) ) }
:nHeadStrAlign := AL_RIGHT
END
WITH OBJECT :aCols[ 05 ]
:bStrData := {|| IF( oRsDsl:RecordCount() > 0 .AND. ;
oRsDsl:Fields( "DIE_EOS" ):Value == "S", ;
Transform( oRsDsl:Fields( "DIE_LTS" ):Value, "@Z 9,999,999" ), Space( 01 ) ) }
:nHeadStrAlign := AL_RIGHT
END
WITH OBJECT :aCols[ 06 ]
:nFooterType := AGGR_SUM
:bSumCondition := { || ! oRsDsl:Fields("DIE_CAN"):Value }
:cFooterPicture := "@Z 99,999,999.99"
:nFootStrAlign := AL_RIGHT
END
WITH OBJECT :aCols[07]
:nFootStrAlign := AL_LEFT
:bFooter := { || "<= no se incluyen los vales cancelados" }
END
:MakeTotals()
WITH OBJECT :aCols[ 10 ]
:SetCheck( { "SI16", "NO16" } )
END
END
As you can see there is one FIELD (oRsDsl:Fields( "DIE_LTS" ):Value) for two columns (4 and 5)
it depends on the field oRsDsl:Fields( "DIE_EOS" ):Value.
how can I get totals for each column (4 and 5)
I've tried with
- Code: Select all Expand view RUN
:nFooterType := AGGR_SUM
:bSumCondition := { || ! oRsDsl:Fields("DIE_CAN"):Value}
:cFooterPicture := "@Z 99,999,999.99"
:nFootStrAlign := AL_RIGHT
There is no error, but it does not work.
Best regards