Code: Select all | Expand
oRs:bOnChangePage = { || vsay := alltrim(STR(oRs:nCurrentPage))+" / "+alltrim( STR(oRs:nMaxPages)),; oSay:refresh(),oBrw:Refresh() }
Code: Select all | Expand
oRs:bOnChangePage = { || vsay := alltrim(STR(oRs:nCurrentPage))+" / "+alltrim( STR(oRs:nMaxPages)),; oSay:refresh(),oBrw:Refresh() }
Code: Select all | Expand
oRs:lAutoPage := .t.
Code: Select all | Expand
oRs:lAutoExpand := .t.
Code: Select all | Expand
oRs := oCn:RowSet( cSql )// set up browse // during runtime//oRs:oCn := oNewCn // OptionaloRs:ReQuery( cNewSql ) // same or different tableoRs:SetXbrColumns( oBrw )
Code: Select all | Expand
#include "fivewin.ch"function Main() local oCn, oRs, oDlg, oBrw local aSql := { "select id,first,city, salary from customer", ; "select * from states", ; "select * from annual" } oCn := FW_DemoDB() oRs := oCn:RowSet( aSql[ 1 ] ) DEFINE DIALOG oDlg SIZE 600,400 PIXEL TRUEPIXEL ; TITLE "SWITCH TABLES/FIELDS AT RUNTIME" @ 60, 20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ; DATASOURCE oRs AUTOCOLS CELL LINES NOBORDER oBrw:CreateFromCode() @ 20, 20 BTNBMP PROMPT "CUSTOMER" ; SIZE 100,35 PIXEL OF oDlg FLAT ; ACTION ( CursorWait(), oRs:Requery( aSql[ 1 ] ), oRs:SetXbrColumns( oBrw ) ) @ 20,140 BTNBMP PROMPT "STATES" ; SIZE 100,35 PIXEL OF oDlg FLAT ; ACTION ( CursorWait(), oRs:Requery( aSql[ 2 ] ), oRs:SetXbrColumns( oBrw ) ) @ 20,260 BTNBMP PROMPT "ANNUAL" ; SIZE 100,35 PIXEL OF oDlg FLAT ; ACTION ( CursorWait(), oRs:Requery( aSql[ 3 ] ), oRs:SetXbrColumns( oBrw ) ) ACTIVATE DIALOG oDlg CENTERED oCn:Close()return nil
Code: Select all | Expand
#define QUINCENA ;"select " + ;"a.id as c1, " + ;"b.nombre as c2, " +;"a.fecha as c3, " + ;"c.id as c4_0, " +;"c.item as c4, " +;"a.pago as c5, " + ;"a.pobreza as c6, " + ;"a.gratis as c7 " + ;"from tbdiario a " + ;"left join tbente as b on b.id = a.idente " +;"left join tbitems as c on c.id = a.iditem "+;"WHERE a.fecha >= ? AND a.fecha <= ? "+ ;"ORDER BY a.iditem, a.fecha "
::oQry := ::oCnx:QUERY( QUINCENA, { ::dInicio, ::dFinal } )
::oQry:setfilter( "c4_0>0 and c4_0<11" )
Code: Select all | Expand
::oQry:setorder( "c2", "c3" ) ::oQry:Requery()
Code: Select all | Expand
::oQry:setFilter( "c2_0<2" ) ::oQry:setorder("c2_0, c3, c4_0")
Code: Select all | Expand
xbrowser ::oQry
Code: Select all | Expand
oRowSet:FCount()