Buena tarde, el método oRecSet:setOrder, permite usar má de columna ...?
La idea es no gastar mas consultas a base de datos para traerla ordenado , tratando de simular al v Dbsetorder de los dbf. Gracias...
oRecSet:SORT := "GAS_IMP,GAS_CVE DESC" // o ASC
AADD( vConBrw,{ "HIS->cCodigoCon", "Cpto" , "XX" , .F. , 6 } )
AADD( vConBrw,{ "HIS->cDocumeTra", "Documento" , REPL("X",8) , .F. , 10 } )
AADD( vConBrw,{ "cFecCor(HIS->dFecTraTra)", "Fecha" , "@D" , .F., 12 } )
AADD( vConBrw,{ "cFecCor(HIS->dFecIniTra)", "Fecha Inicial" , "@D" , .F., 12 } )
AADD( vConBrw,{ "cFecCor(HIS->dFecFinTra)", "Fecha Final" , "@D" , .F., 12 } )
oBrwMovCem := BrowseConsulta( vConBrw, oGrpHis, "HIS",;
fFunMod,;
fFunMod,;
NIL,;
NIL,1,fFunMod,"COLOR MARRON","FONDO" )
FUNCTION BrowseConsulta( vConBrw, oPanBrw, cAliTab, fFunDCl,fFunEnt,fFunDel,;
fFunIns,nColPos,fFunMod,cTipCol,cVerFon,nFonBro)
LOCAL oCajDia, cCol, aItem , oBrwFW2 , K := 1, campo, nPosGui := 0
LOCAL A := "IMAGEN", nRecSel := 0, oBrush, oCol , oFont, J:= 0, oErr
LOCAL aRowGrad
LOCAL aSelGrad
LOCAL XaSelGrad
IF SELECT(cAliTab) == 0
RETURN NIL
ENDIF
XaSelGrad := { { .5, RGB( 255, 238, 185 ), RGB( 255, 237, 178 ) }, ;
{ .5, RGB( 255, 200,34 ), RGB( 255, 233, 162 ) } }
aSelGrad := { { .5, RGB( 191,205,219 ), RGB( 191,205,219 ) }, ;
{ .5, RGB( 191,205,219 ), RGB( 191,205,219 ) } }
IF nFonBro == NIL
DEFINE FONT oFont NAME "Arial Narrow" SIZE 5, 18
ELSEIF nFonBro == 1
DEFINE FONT oFont NAME "Arial" SIZE 8, 10
ELSEIF nFonBro == 2
DEFINE FONT oFont NAME "Times New Roman" SIZE 10, 16
ELSEIF nFonBro == 3
DEFINE FONT oFont NAME "Arial Black" SIZE 12, 10
ELSEIF nFonBro == 4
DEFINE FONT oFont NAME "Courier New" SIZE 14, 10 BOLD
ELSEIF nFonBro == 5
//DEFINE FONT oFonBro NAME "Tahoma" SIZE 0, -16
DEFINE FONT oFont NAME "Arial Narrow" SIZE 8, 20
ELSE
// oFont := M->oFonAc11
oFont:SetFont( M->oFonAc11 )
ENDIF
XbrNumFormat( 'E', .t. )
SYSREFRESH()
INKEY(0.2)
DEFAULT nColPos := 1
DEFAULT fFunMod := NIL
TRY
SELECT (cAliTab)
nRecSel := (cAliTab)->( RecNo() )
IF cVerFon <> nil
IF EMP->cTipConCon == "N"
DEFINE BRUSH oBrush FILE "IMAGENES\FIVEBACK.JPG"
ELSE
DEFINE BRUSH oBrush FILE "IMAGENES\fondo.jpg"
ENDIF
ENDIF
@ 0,0 XBROWSE oBrwFW2 OF oPanBrw;
AUTOSORT FOOTERS FASTEDIT LINES CELL
WITH OBJECT ( oBrwFW2 )
IF M->SW_FONDO
:l2007 := .F.
:bClrHeader := {|| { CLR_WHITE, nRGB( 80, 80, 80 ) } } //87,129,187
:bClrFooter := {|| { CLR_WHITE, nRGB( 80, 80, 80 ) } }
ELSE
:l2007 := .T.
ENDIF
:nStretchCol := 1
:nMarqueeStyle := 4
:bClrSelFocus := { || { CLR_HBLUE, XaSelGrad } }
:bClrRowFocus := { || { CLR_BLACK, aSelGrad } } // NARANJA, CELESTE
//:lKinetic := .F.
:bChange := { || nRecSel := oBrwFW2:BookMark }
//:nMarqueeStyle := MARQSTYLE_HIGHLCELL
:nColDividerStyle := LINESTYLE_BLACK
:nRowDividerStyle := LINESTYLE_BLACK
//:nRowDividerStyle := LINESTYLE_NOLINES
//:nColDividerStyle := LINESTYLE_NOLINES
:lColDividerComplete := .f.
:lColDividerComplete := .F.
:nHeaderLines := 1
:nFooterLines := 1
:nDataLines := 1
:lFooter := .T.
:lFastEdit := .T.
:nFreeze := 1
:cAlias := cAliTab
// &fFunDCl
IF fFunDCl <> NIL
:bLDblClick:= { || &(fFunDCl), oBrwFW2:Refresh() }
ENDIF
IF ALIAS(cAliTab) == "LEC" .OR. ALIAS(cAliTab) == "CAJ" .OR. ;
ALIAS(cAliTab) == "IMP" .OR. ALIAS(cAliTab) == "HIS" .OR. ;
ALIAS(cAliTab) == "CTB" .OR. ALIAS(cAliTab) == "LEA" .OR. ;
ALIAS(cAliTab) == "CAX" .OR. ALIAS(cAliTab) == "HI2" .OR. ;
ALIAS(cAliTab) == "FTM" .OR. ALIAS(cAliTab) == "TCA" .OR. ;
ALIAS(cAliTab) == "DRI"
//
ELSE
IF (cAliTab)->( IndexOrd() ) > 0
:bSeek := {|c| (cAliTab)->( DBSEEK( UPPER(C) ) ) }
ENDIF
ENDIF
:bkeydown := { | nKey,nFlags | EvaluaTecla(cAliTab,oBrwFW2,@nKey,fFunDCl,fFunEnt,fFunDel,fFunIns,fFunMod,nFlags ) }
//:keydown := { |nkey ,nFlags| func1(nkey,nFlags)}
FOR EACH aItem IN vConBrw
WITH OBJECT (oCol := oBrwFW2:AddCol())
// :oDataFont := {|| oFonBro }
:bStrData := MakeValueBlock(@aItem,1, 3 )
:cHeader := HB_OEMTOANSI(aItem[ 2 ])
:nHeadStrAlign := AL_CENTER
IF LEN(aItem)> 8
IF aItem[ 9 ] <> NIL
IF aItem[ 9 ] == "D" .OR. aItem[ 9 ] == "N"
:nDataStrAlign := AL_RIGHT
ELSEIF aItem[ 9 ] == "I"
:nDataStrAlign := AL_LEFT
ELSEIF aItem[ 9 ] == "C"
:nDataStrAlign := AL_CENTER
ENDIF
ENDIF
ENDIF
IF aItem[ 3 ] <> NIL
:cEditPicture := aItem[ 3 ]
ENDIF
IF aItem[ 5 ] <> NIL
:nWidth := aItem[ 5 ] * 8
ELSE
:nWidth := 240
// :nWidth := aItem[ 5 ] * 8 GETTEXTWIDTH(0,REPLICATE("x",vVecAnc[J]),oFonAct:hFont)*nFacFon
ENDIF
IF aItem [ 4 ] // SI ES VERDADERO HABILITA CAPTURA CON GET
:nEditType := 1
:lAutoSave := .F.
//:bOnPostEdit := {|o, v, n| IIF ( n != VK_ESCAPE, ;
// ModificaColumna(oBrwFW2, cAliTab, SUBS(ALLTRIM(aItem[1]), ATNUM('>',aItem[1],1)+1), v, "VALID LOCAL" ), ) }
:bOnPostEdit := {|o, v, n| IIF ( n != VK_ESCAPE, ModificaColumna(oBrwFW2,cAliTab ,;
SUBS(ALLTRIM(aItem[1]),ATNUM('>',aItem[1],1)+1),v,;
"VALID LOCAL",IF( LEN(aItem)>5,aItem[6],NIL),IF(LEN(aItem)>6,aItem[7],NIL),IF(LEN(aItem)>7,aItem[8],NIL) ), NIL ) }
ENDIF
:oDataFont := oFont
:oHeaderFont := oFont
END
:aCols[ :nFreeze ]:bClrStd := {|| { RGB(0,0,0) ,RGB(234,234,234) } } // CLR_WHITE, CLR_BLUE
NEXT nFor
FOR J := 1 TO LEN(:aCols)
//:aCols[J]:bLClickHeader := {|| oBrwFW2:GoTop(), oBrwFW2:Refresh()}
NEXT J
:SetRDD()
IF M->SW_FONDO
IF cTipCol <> NIL
:SetZebra(.T.,{ { CLR_WHITE, RGB( 234,234,234 ) }, { RGB(0,0,0) , RGB( 255,255,242 ) } } )
ELSE //
:SetZebra(.T.,{ { RGB(0,0,0) , RGB( 213,198,187 ) }, { RGB(0,0,0) , RGB( 255,255,242 ) } } )
ENDIF
ELSE
IF cTipCol <> NIL
:SetZebra(.T.,{ { CLR_WHITE, RGB( 234,234,234 ) }, { RGB(0,0,0) , RGB( 255,255,242 ) } } )
ELSE //
:SetZebra(.T.,{ { RGB(0,0,0) , RGB( 234,234,234 ) }, { RGB(0,0,0) , RGB( 255,255,242 ) } } )
ENDIF
ENDIF
//:nStretchCol := STRETCHCOL_LAST
:SetChecks()
//:Married:SetCheck( { "GREEN", "RED" }, EDIT_GET )
:CreateFromCode()
:SetFocus()
:oClient := oBrwFW2
:AdjClient()
:SelectCol(nColPos)
:nMoveType = MOVE_NONE
IF cVerFon <> nil
:SetBackGround( oBrush )
ENDIF
IF ALLTRIM(M->cTipSer) == "DBFCDX"
:refresh()
ENDIF
:HasBorder(.F.)
END
CATCH oErr
alerta("Error. Construyendo browse de consulta")
MyErrorZerus( oErr, "NO SALE DE RUSSOFT" )
RETURN NIL
END
RETURN BrowseConsulta := oBrwFW2
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: No registered users and 114 guests