XBROWSE NO ABRE DBFS CORRECTAMENTE
Posted: Fri Nov 15, 2013 4:54 pm
Estimados :
Tengo un XBROWSE y un folder y abro 2 bases de datos en cada hoja en la primera INGRESOS y la otra SALIDA; pero en el 1era hoja sólo se ve el 1er registro de la base y en la segunda de forma normal. Falta algo?. He reindexado la data, he cambiado la variable del Browse, también probé sin abrir los índices y por último bloquee la segunda hoja (y si abrió normal cuando la otra data la bloquee). Adjunto el .prg, y el .rc.
INGRESOS - PESTAÑA 1
FECHA DOC SERIE NUMERO
04/10/09 01 012 000523
04/10/09 01 012 000523
04/10/09 01 012 000523
SALIDAS - PESTAÑA 2
FECHA UNIDAD
01/04/09 T001
02/04/09 T002
03/0409 T003
...así sucesivamente en la pestaña 1 se ve el mismo registro y la segunda pestaña se ve de forma normal.
Alguna ayuda? Gracias.
//---------------------
FUNCTION Sys280(oWPpal)
LOCAL oWnd, oDlg, oIco, oLbx, oBrw, cNom, n, nx, oFon1, nNroReg, oBtn[6], oBrush, oBrush1, oFld1, oDlgActive
DEFINE BRUSH oBrush COLOR RGB(238,238,238)
DEFINE BRUSH oBrush1 FILE "wall.bmp"
DEFINE ICON oIco RESOURCE "GUIINGALentes"
DEFINE FONT oFon1 NAME "Arial Negrita" SIZE 0,-13
DEFINE WINDOW oWnd FROM 0,0 TO 35.4,126.0;
TITLE "Mantenimiento de Ingresos y Salidas "+"["+PROCNAME()+"]";
ICON oIco;
NOZOOM;
MDICHILD OF oWPpal
USE GUIINGAL INDE GUIINGA1,GUIINGA2,GUIINGA3,GUIINGA4 SHARED ALIAS GUIINGAL NEW
USE GUISAL INDE GUISAL1,GUISAL2,GUISAL3,GUISAL4,GUISAL5 SHARED ALIAS GUISAL NEW
DEFINE DIALOG oDlg RESOURCE "MANTENIMIENTOS" BRUSH oBrush Transparent of oWnd FONT oFon1
REDEFINE FOLDER oFld1 ID 101 OF oDlg ;
PROMPT "&Ingresos", "&Egresos" ;
DIALOGS "ACTMOV", "ACTMOV"
//---- Dialogo 1 -----//
dbSelectArea("GUIINGAL")
GUIINGAL->(OrdSetFocus("GUIINGA1"))
REDEFINE XBROWSE oLbx ;
FIELDS DTOC(GUIINGAL->GUIFEC),;
Oemtoansi(GUIINGAL->DOC),;
Oemtoansi(GUIINGAL->SERIE),;
Oemtoansi(GUIINGAL->NUMERO),;
Oemtoansi(GUIINGAL->CODIGO),;
Oemtoansi(GUIINGAL->NOMBRE),;
Oemtoansi(GUIINGAL->POCOD),;
Oemtoansi(GUIINGAL->CODDES),;
TRANSFORM(GUIINGAL->POCANT,"999,999"),;
TRANSFORM(GUIINGAL->PRECIO,"999,999.99"),;
TRANSFORM(GUIINGAL->POCANT*GUIINGAL->PRECIO,"999,999.99");
HEADERS "Fecha","Doc","Serie","Numero","Codigo","Proveedor","Articulo","Detalle","Cantidad","Precio","Total";
FIELDSIZES 60, 40, 50, 80, 60, 170, 70, 190, 70, 70, 80;
ON DBLCLICK ( EditList(.F.,oWPpal), oLbx:Refresh() );
LINES ;
ID 120 OF oFld1:aDialogs[ 1 ]
oLbx:aJustify := {.F.,.F.,.F.,.F.,.F.,.F.,.F.,.F.,.T.,.T.,.T.}
oLbx:bKeyDown := {|nKey| iif(nKey=13, ( EditList(.F.,oWPpal), oLbx:Refresh() ),;
iif(nKey=46 .AND. Confirma("¨Deseas Borrar la entrada "+AllTrim(GUIINGAL->Nombres)+"?"),;
(Iif(Rlock(),GUIINGAL->(dbDelete()),),;
oLbx:nRowSel:=1, oLbx:Refresh()),;
iif(nKey=65 ,(EditList(.T.,oWPpal), oLbx:nRowSel := 1, oLbx:Refresh()),;
iif(nKey=77 ,(EditList(.F.,oWPpal), oLbx:Refresh()),;
iif(nKey=66 .AND. Confirma("¨Deseas Borrar la entrada "+AllTrim(GUIINGAL->Nombres)+"?"),;
(Iif(Rlock(),GUIINGAL->(dbDelete()),),;
oLbx:nRowSel:=1, oLbx:Refresh()),;
iif(nKey=73 ,ImpLista(),;
iif(nKey=27 ,oWnd:End(), ))))))) }
oLbx:nMarqueeStyle := MARQSTYLE_HIGHLROWMS
oLbx:bClrRowFocus := { || { CLR_WHITE, RGB( 0,150,193 ) } }
oLbx:aCols[02]:cSortOrder := "GUIINGAL1" // NOMBRES
oLbx:aCols[03]:cSortOrder := "GUIINGAL1" // PERS NAT
oLbx:aCols[04]:cSortOrder := "GUIINGAL1" // DIRECCION
oLbx:aCols[05]:cSortOrder := "GUIINGAL3" // DISTRITO
//---- Dialogo 2 -----//
dbSelectArea("GUISAL")
GUISAL->(OrdSetFocus("GUISAL5"))
REDEFINE XBROWSE oBrw ;
FIELDS DTOC(GUISAL->GUIFEC),;
Oemtoansi(GUISAL->UNIDAD),;
Oemtoansi(GUISAL->NOMBRE),;
Oemtoansi(GUISAL->POCOD),;
Oemtoansi(GUISAL->CODDES),;
TRANSFORM(GUISAL->POCANT,"999,999"),;
TRANSFORM(GUISAL->PRECIO,"999,999.99"),;
TRANSFORM(GUISAL->POCANT*GUISAL->PRECIO,"999,999.99"),;
Oemtoansi(GUISAL->FIRMA);
HEADERS "Fecha","Unidad","Placa","Artículo","Detalle","Cantidad","Precio","Total","Responsable";
FIELDSIZES 60, 60, 70, 80, 255, 70, 70, 90, 170;
ON DBLCLICK ( EditList(.F.,oWPpal), oBrw:Refresh() );
LINES ;
ID 120 OF oFld1:aDialogs[ 2 ]
oBrw:aJustify := {.F.,.F.,.F.,.F.,.F.,.T.,.T.,.T.,.F.}
oBrw:bKeyDown := {|nKey| iif(nKey=13, ( EditList(.F.,oWPpal), oBrw:Refresh() ),;
iif(nKey=46 .AND. Confirma("¨Deseas Borrar la entrada "+AllTrim(GUISAL->Nombres)+"?"),;
(Iif(Rlock(),GUISAL->(dbDelete()),),;
oBrw:nRowSel:=1, oBrw:Refresh()),;
iif(nKey=65 ,(EditList(.T.,oWPpal), oBrw:nRowSel := 1, oBrw:Refresh()),;
iif(nKey=77 ,(EditList(.F.,oWPpal), oBrw:Refresh()),;
iif(nKey=66 .AND. Confirma("¨Deseas Borrar la entrada "+AllTrim(GUISAL->Nombres)+"?"),;
(Iif(Rlock(),GUISAL->(dbDelete()),),;
oBrw:nRowSel:=1, oBrw:Refresh()),;
iif(nKey=73 ,ImpLista(),;
iif(nKey=27 ,oWnd:End(), ))))))) }
oBrw:nMarqueeStyle := MARQSTYLE_HIGHLROWMS
oBrw:bClrRowFocus := { || { CLR_WHITE, RGB( 0,150,193 ) } }
oBrw:aCols[01]:cSortOrder := "GUISAL5" // FECHA
oBrw:aCols[02]:cSortOrder := "GUISAL1" // UNIDAD
oBrw:aCols[04]:cSortOrder := "GUISAL3" // REPUESTO
oBrw:aCols[04]:cSortOrder := "GUISAL4" // DIRECCION
REDEFINE GET cNom ID 174 OF oDlg
REDEFINE BTNBMP oBtn[1] ID 170 RESOURCE 1170 OF oDlg
REDEFINE BTNBMP oBtn[2] ID 171 RESOURCE 1180 OF oDlg
REDEFINE BTNBMP oBtn[3] ID 173 RESOURCE 1190 OF oDlg
REDEFINE BTNBMP oBtn[4] ID 200 RESOURCE 1200 OF oDlg
REDEFINE BTNBMP oBtn[5] ID 210 RESOURCE 1210 OF oDlg
REDEFINE BTNBMP oBtn[6] ID 175 RESOURCE 1240 OF oDlg ACTION (oDlg:End(), oWnd:End())
For n := 1 to 6
oBtn[n]:nClrPane = RGB(0,0,0)
Next
oFld1:aDialogs[ 1 ]:SetBrush( oBrush1 )
oFld1:aDialogs[ 2 ]:SetBrush( oBrush1 )
oDlgActive = oFld1:aDialogs[ 1 ]
ACTIVATE DIALOG oDlg NOWAIT ON INIT (oDlg:Move(0,0))
ACTIVATE WINDOW oWnd VALID Eval({|| GUIINGAL->(dbCloseArea()), .T.})
oFon1:End()
RELEASE BRUSH oBrush
RETURN NIL
ARCHIVO .RC
MANTENIMIENTOS DIALOG 3, 3, 673, 333
STYLE WS_CHILD | WS_VISIBLE
FONT 8, "Arial"
{
CONTROL "", -1, "STATIC", SS_BLACKFRAME | WS_CHILD | WS_VISIBLE, 8, 3, 252, 30
CONTROL "", -1, "STATIC", SS_BLACKFRAME | WS_CHILD | WS_VISIBLE, 10, 5, 248, 26
CONTROL "", 170, "TBtnBmp", 0 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 11, 7, 41, 23
CONTROL "", 171, "TBtnBmp", 0 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 52, 7, 41, 23
CONTROL "", 173, "TBtnBmp", 0 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 93, 7, 41, 23
CONTROL "", 200, "TBtnBmp", 0 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 134, 7, 41, 23
CONTROL "", 210, "TBtnBmp", 0 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 175, 7, 41, 23
CONTROL "", 175, "TBtnBmp", 0 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 216, 7, 41, 23
EDITTEXT 174, 321, 13, 310, 15, WS_BORDER | WS_TABSTOP
LTEXT "Localizar", -1, 274, 15, 43, 11
GROUPBOX "", 176, 265, 5, 373, 26, BS_GROUPBOX | WS_GROUP
ICON "AUTOLAY", 199, 644, 9, 18, 18
CONTROL "", -1, "STATIC", SS_BLACKFRAME | WS_CHILD | WS_VISIBLE, 641, 5, 27, 26
CONTROL "", -1, "STATIC", SS_BLACKFRAME | WS_CHILD | WS_VISIBLE, 643, 7, 23, 22
CONTROL "", 101, "SysTabControl32", 0 | WS_CHILD | WS_VISIBLE, 1, 36, 670, 294
}
ACTMOV DIALOG 12, 14, 662, 279
STYLE WS_CHILD
FONT 8, "MS Sans Serif"
{
CONTROL "", 120, "TXBrowse", 0 | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP, 3, 3, 657, 273
}
Tengo un XBROWSE y un folder y abro 2 bases de datos en cada hoja en la primera INGRESOS y la otra SALIDA; pero en el 1era hoja sólo se ve el 1er registro de la base y en la segunda de forma normal. Falta algo?. He reindexado la data, he cambiado la variable del Browse, también probé sin abrir los índices y por último bloquee la segunda hoja (y si abrió normal cuando la otra data la bloquee). Adjunto el .prg, y el .rc.
INGRESOS - PESTAÑA 1
FECHA DOC SERIE NUMERO
04/10/09 01 012 000523
04/10/09 01 012 000523
04/10/09 01 012 000523
SALIDAS - PESTAÑA 2
FECHA UNIDAD
01/04/09 T001
02/04/09 T002
03/0409 T003
...así sucesivamente en la pestaña 1 se ve el mismo registro y la segunda pestaña se ve de forma normal.
Alguna ayuda? Gracias.
//---------------------
FUNCTION Sys280(oWPpal)
LOCAL oWnd, oDlg, oIco, oLbx, oBrw, cNom, n, nx, oFon1, nNroReg, oBtn[6], oBrush, oBrush1, oFld1, oDlgActive
DEFINE BRUSH oBrush COLOR RGB(238,238,238)
DEFINE BRUSH oBrush1 FILE "wall.bmp"
DEFINE ICON oIco RESOURCE "GUIINGALentes"
DEFINE FONT oFon1 NAME "Arial Negrita" SIZE 0,-13
DEFINE WINDOW oWnd FROM 0,0 TO 35.4,126.0;
TITLE "Mantenimiento de Ingresos y Salidas "+"["+PROCNAME()+"]";
ICON oIco;
NOZOOM;
MDICHILD OF oWPpal
USE GUIINGAL INDE GUIINGA1,GUIINGA2,GUIINGA3,GUIINGA4 SHARED ALIAS GUIINGAL NEW
USE GUISAL INDE GUISAL1,GUISAL2,GUISAL3,GUISAL4,GUISAL5 SHARED ALIAS GUISAL NEW
DEFINE DIALOG oDlg RESOURCE "MANTENIMIENTOS" BRUSH oBrush Transparent of oWnd FONT oFon1
REDEFINE FOLDER oFld1 ID 101 OF oDlg ;
PROMPT "&Ingresos", "&Egresos" ;
DIALOGS "ACTMOV", "ACTMOV"
//---- Dialogo 1 -----//
dbSelectArea("GUIINGAL")
GUIINGAL->(OrdSetFocus("GUIINGA1"))
REDEFINE XBROWSE oLbx ;
FIELDS DTOC(GUIINGAL->GUIFEC),;
Oemtoansi(GUIINGAL->DOC),;
Oemtoansi(GUIINGAL->SERIE),;
Oemtoansi(GUIINGAL->NUMERO),;
Oemtoansi(GUIINGAL->CODIGO),;
Oemtoansi(GUIINGAL->NOMBRE),;
Oemtoansi(GUIINGAL->POCOD),;
Oemtoansi(GUIINGAL->CODDES),;
TRANSFORM(GUIINGAL->POCANT,"999,999"),;
TRANSFORM(GUIINGAL->PRECIO,"999,999.99"),;
TRANSFORM(GUIINGAL->POCANT*GUIINGAL->PRECIO,"999,999.99");
HEADERS "Fecha","Doc","Serie","Numero","Codigo","Proveedor","Articulo","Detalle","Cantidad","Precio","Total";
FIELDSIZES 60, 40, 50, 80, 60, 170, 70, 190, 70, 70, 80;
ON DBLCLICK ( EditList(.F.,oWPpal), oLbx:Refresh() );
LINES ;
ID 120 OF oFld1:aDialogs[ 1 ]
oLbx:aJustify := {.F.,.F.,.F.,.F.,.F.,.F.,.F.,.F.,.T.,.T.,.T.}
oLbx:bKeyDown := {|nKey| iif(nKey=13, ( EditList(.F.,oWPpal), oLbx:Refresh() ),;
iif(nKey=46 .AND. Confirma("¨Deseas Borrar la entrada "+AllTrim(GUIINGAL->Nombres)+"?"),;
(Iif(Rlock(),GUIINGAL->(dbDelete()),),;
oLbx:nRowSel:=1, oLbx:Refresh()),;
iif(nKey=65 ,(EditList(.T.,oWPpal), oLbx:nRowSel := 1, oLbx:Refresh()),;
iif(nKey=77 ,(EditList(.F.,oWPpal), oLbx:Refresh()),;
iif(nKey=66 .AND. Confirma("¨Deseas Borrar la entrada "+AllTrim(GUIINGAL->Nombres)+"?"),;
(Iif(Rlock(),GUIINGAL->(dbDelete()),),;
oLbx:nRowSel:=1, oLbx:Refresh()),;
iif(nKey=73 ,ImpLista(),;
iif(nKey=27 ,oWnd:End(), ))))))) }
oLbx:nMarqueeStyle := MARQSTYLE_HIGHLROWMS
oLbx:bClrRowFocus := { || { CLR_WHITE, RGB( 0,150,193 ) } }
oLbx:aCols[02]:cSortOrder := "GUIINGAL1" // NOMBRES
oLbx:aCols[03]:cSortOrder := "GUIINGAL1" // PERS NAT
oLbx:aCols[04]:cSortOrder := "GUIINGAL1" // DIRECCION
oLbx:aCols[05]:cSortOrder := "GUIINGAL3" // DISTRITO
//---- Dialogo 2 -----//
dbSelectArea("GUISAL")
GUISAL->(OrdSetFocus("GUISAL5"))
REDEFINE XBROWSE oBrw ;
FIELDS DTOC(GUISAL->GUIFEC),;
Oemtoansi(GUISAL->UNIDAD),;
Oemtoansi(GUISAL->NOMBRE),;
Oemtoansi(GUISAL->POCOD),;
Oemtoansi(GUISAL->CODDES),;
TRANSFORM(GUISAL->POCANT,"999,999"),;
TRANSFORM(GUISAL->PRECIO,"999,999.99"),;
TRANSFORM(GUISAL->POCANT*GUISAL->PRECIO,"999,999.99"),;
Oemtoansi(GUISAL->FIRMA);
HEADERS "Fecha","Unidad","Placa","Artículo","Detalle","Cantidad","Precio","Total","Responsable";
FIELDSIZES 60, 60, 70, 80, 255, 70, 70, 90, 170;
ON DBLCLICK ( EditList(.F.,oWPpal), oBrw:Refresh() );
LINES ;
ID 120 OF oFld1:aDialogs[ 2 ]
oBrw:aJustify := {.F.,.F.,.F.,.F.,.F.,.T.,.T.,.T.,.F.}
oBrw:bKeyDown := {|nKey| iif(nKey=13, ( EditList(.F.,oWPpal), oBrw:Refresh() ),;
iif(nKey=46 .AND. Confirma("¨Deseas Borrar la entrada "+AllTrim(GUISAL->Nombres)+"?"),;
(Iif(Rlock(),GUISAL->(dbDelete()),),;
oBrw:nRowSel:=1, oBrw:Refresh()),;
iif(nKey=65 ,(EditList(.T.,oWPpal), oBrw:nRowSel := 1, oBrw:Refresh()),;
iif(nKey=77 ,(EditList(.F.,oWPpal), oBrw:Refresh()),;
iif(nKey=66 .AND. Confirma("¨Deseas Borrar la entrada "+AllTrim(GUISAL->Nombres)+"?"),;
(Iif(Rlock(),GUISAL->(dbDelete()),),;
oBrw:nRowSel:=1, oBrw:Refresh()),;
iif(nKey=73 ,ImpLista(),;
iif(nKey=27 ,oWnd:End(), ))))))) }
oBrw:nMarqueeStyle := MARQSTYLE_HIGHLROWMS
oBrw:bClrRowFocus := { || { CLR_WHITE, RGB( 0,150,193 ) } }
oBrw:aCols[01]:cSortOrder := "GUISAL5" // FECHA
oBrw:aCols[02]:cSortOrder := "GUISAL1" // UNIDAD
oBrw:aCols[04]:cSortOrder := "GUISAL3" // REPUESTO
oBrw:aCols[04]:cSortOrder := "GUISAL4" // DIRECCION
REDEFINE GET cNom ID 174 OF oDlg
REDEFINE BTNBMP oBtn[1] ID 170 RESOURCE 1170 OF oDlg
REDEFINE BTNBMP oBtn[2] ID 171 RESOURCE 1180 OF oDlg
REDEFINE BTNBMP oBtn[3] ID 173 RESOURCE 1190 OF oDlg
REDEFINE BTNBMP oBtn[4] ID 200 RESOURCE 1200 OF oDlg
REDEFINE BTNBMP oBtn[5] ID 210 RESOURCE 1210 OF oDlg
REDEFINE BTNBMP oBtn[6] ID 175 RESOURCE 1240 OF oDlg ACTION (oDlg:End(), oWnd:End())
For n := 1 to 6
oBtn[n]:nClrPane = RGB(0,0,0)
Next
oFld1:aDialogs[ 1 ]:SetBrush( oBrush1 )
oFld1:aDialogs[ 2 ]:SetBrush( oBrush1 )
oDlgActive = oFld1:aDialogs[ 1 ]
ACTIVATE DIALOG oDlg NOWAIT ON INIT (oDlg:Move(0,0))
ACTIVATE WINDOW oWnd VALID Eval({|| GUIINGAL->(dbCloseArea()), .T.})
oFon1:End()
RELEASE BRUSH oBrush
RETURN NIL
ARCHIVO .RC
MANTENIMIENTOS DIALOG 3, 3, 673, 333
STYLE WS_CHILD | WS_VISIBLE
FONT 8, "Arial"
{
CONTROL "", -1, "STATIC", SS_BLACKFRAME | WS_CHILD | WS_VISIBLE, 8, 3, 252, 30
CONTROL "", -1, "STATIC", SS_BLACKFRAME | WS_CHILD | WS_VISIBLE, 10, 5, 248, 26
CONTROL "", 170, "TBtnBmp", 0 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 11, 7, 41, 23
CONTROL "", 171, "TBtnBmp", 0 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 52, 7, 41, 23
CONTROL "", 173, "TBtnBmp", 0 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 93, 7, 41, 23
CONTROL "", 200, "TBtnBmp", 0 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 134, 7, 41, 23
CONTROL "", 210, "TBtnBmp", 0 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 175, 7, 41, 23
CONTROL "", 175, "TBtnBmp", 0 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 216, 7, 41, 23
EDITTEXT 174, 321, 13, 310, 15, WS_BORDER | WS_TABSTOP
LTEXT "Localizar", -1, 274, 15, 43, 11
GROUPBOX "", 176, 265, 5, 373, 26, BS_GROUPBOX | WS_GROUP
ICON "AUTOLAY", 199, 644, 9, 18, 18
CONTROL "", -1, "STATIC", SS_BLACKFRAME | WS_CHILD | WS_VISIBLE, 641, 5, 27, 26
CONTROL "", -1, "STATIC", SS_BLACKFRAME | WS_CHILD | WS_VISIBLE, 643, 7, 23, 22
CONTROL "", 101, "SysTabControl32", 0 | WS_CHILD | WS_VISIBLE, 1, 36, 670, 294
}
ACTMOV DIALOG 12, 14, 662, 279
STYLE WS_CHILD
FONT 8, "MS Sans Serif"
{
CONTROL "", 120, "TXBrowse", 0 | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP, 3, 3, 657, 273
}