COLUMN oRep:nCounter TITLE "Counter" PICTURE "9999"
oReport:bSkip := {|| nLine++ , ...... dbf->( DBSKIP() )}
but if I use the TOTAL clause the page and report totals are wrong. On page totals it add the oRep:nCounter data as a total.
#include 'fivewin.ch'
#include 'report.ch'
REQUEST DBFCDX
function Main()
local cAlias, oWnd
if ( cAlias := OpenData() ) != nil
DEFINE WINDOW oWnd
ACTIVATE WINDOW oWnd HIDDEN ;
ON INIT ( ( cAlias )->( Report() ), oWnd:End() )
endif
( cAlias )->( DbCloseArea() )
return nil
function Report()
local oRep, oFont
local cAlias := Alias()
DEFINE FONT oFont NAME 'TAHOMA' SIZE 0,-9
REPORT oRep FONT oFont PREVIEW
COLUMN TITLE "LineNo" DATA oRep:nCounter + 1 ;
PICTURE "9999" TOTAL FOR .f.
COLUMN TITLE "UNIT" DATA 1 PICTURE "999" TOTAL
COLUMN TITLE "First" DATA ( cAlias )->FIRST SIZE 20
COLUMN TITLE "State" DATA ( cAlias )->STATE SIZE 5
COLUMN TITLE "Age" DATA ( cAlias )->AGE ;
PICTURE "9999" RIGHT
COLUMN TITLE "Salary" DATA ( cAlias )->SALARY ;
PICTURE "99,999,999.99" RIGHT TOTAL
ENDREPORT
ACTIVATE REPORT oRep ;
ON ENDPAGE ( oRep:aColumns[ 1 ]:nTotal := oRep:nCounter )
RELEASE FONT oFont
return nil
static function OpenData()
local cAlias, lOpen := .f.
cAlias := cGetNewAlias( "CUST" )
USE C:\FWH\samples\customer.dbf ;
NEW ALIAS (cAlias) SHARED VIA 'DBFCDX'
lOpen := Select( cAlias ) > 0
return If( lOpen, cAlias, '' )
oRep:bFor := {|| ( cAlias )->SALARY >= 100000}
HunterEC wrote:James:
Do you mean by way of SET FILTER TO ? If so, I don't like it because it is too slow. Any other suggestions ? Thank you.
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 140 guests