#include "tdolphin.ch"
#include "fivewin.ch"
FUNCTION Main()
LOCAL oServer, oBrw, oQry
CONNECT oServer HOST 'localhost' ;
USER 'user' ;
PASSWORD 'mypass' ;
PORT 3306 ;
FLAGS 0;
DATABASE 'test'
oServer:Execute("CREATE TEMPORARY TABLE IF NOT EXISTS temp "+;
" (SELECT c.codpro as codigo, p.nombre as proveedor, sum(importe) as importe "+;
" FROM compras c INNER JOIN proveedores p ON c.codpro = p.codigo GROUP BY c.codpro) ")
oQry := oServer:Query("SELECT * FROM temp")
oQry:SetWhere("importe > 10000")
xbrowse(oQry)
RETURN nil
cSql:=[ SELECT DOC_CODSUC,DOC_TIPDOC,DOC_TIPTRA,DOC_NUMERO,DOC_FECHA,COUNT(*) AS CUANTOS]+;
[ FROM DPDOCCLI ]+;
[ WHERE DOC_TIPTRA="D" ]+;
[ GROUP BY DOC_CODSUC,DOC_TIPDOC,DOC_TIPTRA,DOC_NUMERO,DOC_FECHA ]+;
[ HAVING CUANTOS>1 ]+;
[ ORDER BY DOC_CODSUC,DOC_TIPDOC,DOC_TIPTRA,DOC_NUMERO,DOC_FECHA ]
carlos vargas wrote:Interesante, en que momento deja de existir esa tabla temporal?
WITH OBJECT oBrwFac
:aCols[5]:cEditPicture:= "@E 9,999,999,999.99"
:aCols[5]:nFooterType := AGGR_TOTAL
:aCols[6]:cEditPicture:= "@E 9,999,999,999.99"
:aCols[6]:nFooterType := AGGR_TOTAL
:aCols[7]:cEditPicture:= "@E 9,999,999,999.99"
:aCols[7]:nFooterType := AGGR_TOTAL
:MakeTotals()
END
#include "fivewin.ch"
function Main()
local oServer, oQry
FWNumFormat( "E", .t. )
oServer := TDolphinSrv():New( "208.91.198.197", "gnraofwh", "Bharat@1950", ;
0, 0, "fwhdemo" )
oQry := oServer:Query( "select id,first as Name, salary as Amount from customer" )
XBROWSER oQry SETUP ( ;
oBrw:Amount:nFooterType := AGGR_SUM, ;
oBrw:MakeTotals(), ;
oBrw:lFooter := .t. )
oQry:End()
oServer:End()
return nil
Necesito filtrar una consulta de tDolphin despues de realizada para mostrarla en un xBrowse.
#include "fivewin.ch"
function Main()
local oServer, oQry
FWNumFormat( "E", .t. )
oServer := TDolphinSrv():New( "208.91.198.197", "gnraofwh", "Bharat@1950", ;
0, 0, "fwhdemo" )
oQry := oServer:Query( "select id,first as Name, salary as Amount from customer" )
XBROWSER oQry SHOW RECID SETUP ( ;
oBrw:Amount:nFooterType := AGGR_SUM, ;
oBrw:MakeTotals(), ;
oBrw:lFooter := .t., ;
oBrw:bRClicked := { |r,c,f,o| BrwRecs( o, { |Self| ( ::Amount:Value % 19 ) == 0 } ) } )
oQry:End()
oServer:End()
return nil
static function BrwRecs( oBrw, bFilter )
local aRecs := {}
Eval( oBrw:bGoTop )
repeat
if Eval( bFilter, oBrw )
AAdd( aRecs, oBrw:BookMark )
endif
until Eval( oBrw:bSkip, 1 ) == 0
oBrw:aFilter := aRecs
oBrw:GoTop()
oBrw:MakeTotals()
oBrw:Refresh()
return nil
:aCols[ 07 ]:nFooterType := AGGR_SUM
:aCols[ 08 ]:nFooterType := AGGR_SUM
:aCols[ 09 ]:nFooterType := AGGR_SUM
:aCols[ 01 ]:cFooterPicture:= "9999"
:aCols[ 07 ]:cFooterPicture:= "999,999,999.99"
:aCols[ 08 ]:cFooterPicture:= "999,999,999.99"
:aCols[ 09 ]:cFooterPicture:= "999,999,999.99"
carlos vargas wrote:
- Code: Select all Expand view
:aCols[ 07 ]:nFooterType := AGGR_SUM
:aCols[ 08 ]:nFooterType := AGGR_SUM
:aCols[ 09 ]:nFooterType := AGGR_SUM
:aCols[ 01 ]:cFooterPicture:= "9999"
:aCols[ 07 ]:cFooterPicture:= "999,999,999.99"
:aCols[ 08 ]:cFooterPicture:= "999,999,999.99"
:aCols[ 09 ]:cFooterPicture:= "999,999,999.99"
FWNumFormat( "E", .t. ) // European format with thousand separators
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: nageswaragunupudi and 53 guests