Code: Select all | Expand
* ------------------------------------------------------------------
FUNCTION FiltraVarIva(aVarIva, aOpcion,oDlg)
* ------------------------------------------------------------------
Local aPie[9]
Local nIni , nFin
AFILL(aPie,0)
oDlg:End()
Do Case
Case aOpcion[3] == 1
FIVA->(OrdSetFocus(1))
FIVA->(dbGotop())
FIVA->(OrdScope(0,aVarIva[1]))
FIVA->(OrdScope(1,aVarIva[2]))
Case aOpcion[3] == 2
FIVA->(OrdSetFocus(2))
FIVA->(dbGotop())
FIVA->(ordScope(0,aVarIva[3]))
FIVA->(ordScope(1,aVarIva[4]))
Case aOpcion[3] == 3
FIVA->(OrdSetFocus(3))
FIVA->(dbGotop())
FIVA->(ordScope(0,aVarIva[5]))
FIVA->(ordScope(1,aVarIva[6]))
EndCase
FIVA->(dbGotop())
While FIVA->(!Eof())
aPie[1] += FIVA->(FieldGet(09))
aPie[2] += FIVA->(FieldGet(11))
aPie[3] += FIVA->(FieldGet(13))
aPie[4] += FIVA->(FieldGet(14))
aPie[5] += FIVA->(FieldGet(16))
aPie[6] += FIVA->(FieldGet(18))
aPie[7] += FIVA->(FieldGet(19))
aPie[8] += FIVA->(FieldGet(20))
aPie[9] += FIVA->(FieldGet(21))
FIVA->(dbSkip())
EndDo
FIVA->(dbGotop())
If aOpcion[1] == 1
PantFraIva(aVarIva,aOpcion,oDlg,aPie)
Else
ImprFraIva(aVarIva,aOpcion,oDlg)
EndIf
FIVA->(OrdScope(0,nil))
FIVA->(OrdScope(1,nil))
Return nil
*-------------------------------------------------------------------------------
FUNCTION PantFraIva(aVarIva,aOpcion,oDlg,aPie)
*-------------------------------------------------------------------------------
Local oWnd,oBar
Local oSay[3]
Local oBrw
Local cTexto1 := "Listado de Facturas "+If (aOpcion[2]= 1,"Emitidas","Recibidas")
Local cTexto2 := aDatEmp[2]+" "+Str(aDatEmp[7])
* oDlg:End()
* FIVA->(dbGotop())
DEFINE WINDOW oWnd MDICHILD of oWmain FONT oFont ;
TITLE cTexto1
DEFINE BUTTONBAR oBar1 OF oWnd SIZE 60, 50 2007
DEFINE BUTTON OF oBar1 ACTION oWnd:End() ;
RESOURCE "Salir" PROMPT "Salir" TOOLTIP "Salir de esta pantalla"
oBrw = TXBrowse():New( oWnd )
oBrw:nColDividerStyle := LINESTYLE_BLACK
oBrw:nRowDividerStyle := LINESTYLE_BLACK
oBrw:lRecordSelector := .t.
oBrw:nHeaderLines := 1
oBrw:nDataLines := 1
oBrw:nRowSel := 1
oBrw:nMarqueeStyle := 5
oBrw:bClrSelFocus := {||{RGB(255,204,204),RGB(176,196,222 )}}
oBrw:cAlias := "FIVA"
oBrw:bClrStd := {|| { nRGB( 0, 0, 51), nRGB(204,204,102) } } // colores para lineas normales
oBrw:bClrSel := {|| { nRGB(0,0,0), nRGB(241,222,088) } } // para barra de linea selecc cuando el control no tiene el foco
oBrw:bClrSelFocus := {|| { nRGB( 0, 0, 0), nRGB(153,204,255) } } // para barra de linea selecc cuando el control tiene el foco
oBrw:lFooter := .t.
oBrw:lFastEdit := .F.
oBrw:nFreeze := 5
oBrw:CreateFromCode()
For n := 22 to Len(oBrw:aCols())
oBrw:DelCol(n)
If(n > 22, n:= 22, n)
If n = Len(oBrw:aCols())
oBrw:DelCol(n)
exit
EndIf
sysrefresh()
EndFor
oBrw:aCols[5]:cFooter := "Totales..."
oBrw:aCols[09]:cFooter := Transform(aPie[1],"9,999,999.99")
oBrw:aCols[11]:cFooter := Transform(aPie[2],"9,999,999.99")
oBrw:aCols[13]:cFooter := Transform(aPie[3],"9,999,999.99")
oBrw:aCols[14]:cFooter := Transform(aPie[4],"9,999,999.99")
oBrw:aCols[16]:cFooter := Transform(aPie[5],"9,999,999.99")
oBrw:aCols[18]:cFooter := Transform(aPie[6],"9,999,999.99")
oBrw:aCols[19]:cFooter := Transform(aPie[7],"9,999,999.99")
oBrw:aCols[20]:cFooter := Transform(aPie[8],"9,999,999.99")
oBrw:aCols[21]:cFooter := Transform(aPie[9],"9,999,999.99")
oWnd:oClient := oBrw
ACTIVATE Window oWnd Maximized;
ON INIT oBrw:SetFocus();
valid(dbCloseAll(),.t.)
SysRefresh()
Return( nil )
Este es el módulo que me trae de cabeza. Despues de un dialogo donde se solicitan los datos para presentar o imprimir, al pulsar el boton aceptar del dialogo, lo envio a una funcion de comprobacion de los datos y de ésta a la funcion filtrariva que es la primera que teneis. Supuestamente en esa funcion (filtrariva) el scope funciona, pues los datos del pie, son buenos, y cuando pasa a la funcion pantfraiva el browse se genera y presenta bien los datos (siempre y cuando no superen la ventana del browse) pero una vez que has recorrido los datos visibles, llega la sorpresa, el resto de los datos tambien son presentados (el resto de los datos son aquellos que deben estar fuera del scope), y ese es mi problema