Please make only this one change in the report.prg:
In the Method Activate(), locate these lines:
- Code: Select all Expand view
- if !::lHaru .and. Empty( ::oDevice:cFile ) .and. !PrintQueue()
Eval( ::bPreview, ::oDevice )
else
PrintEnd()
endif
Delete all these lines and substitute only one line:
- Code: Select all Expand view
- PrintEnd()
Then test your code.
I tested with this code and it is working fine:
You may also try this code first as it is and then use it in your programs
- Code: Select all Expand view
- function TestReport()
local oRep, oFont
local nLine := 0
USE CUSTOMER NEW SHARED
GO TOP
DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-12
REPORT oRep FONT oFont PREVIEW ;
TITLE "CUSTOMER" ;
FOOTER FWString( "Page" ) + " : " + cValToChar( oRep:oDevice:nPage ) + "/" + ;
oRep:oDevice:cLastPage ;
CENTER
COLUMN TITLE "LINE" DATA nLine FONT 1 SIZE 4
COLUMN TITLE "NAME" DATA FIELD->FIRST FONT 1 SIZE 15
COLUMN TITLE "SURNAME" DATA FIELD->LAST FONT 1 RIGHT SIZE 15
COLUMN TITLE "CITY" DATA FIELD->CITY FONT 1 CENTER SIZE 15
COLUMN TITLE "STATE" DATA FIELD->STATE FONT 1 CENTER
COLUMN TITLE "SALARY" DATA FIELD->SALARY PICTURE "$ 9,999,999.99";
FONT 1 TOTAL SIZE 14
ENDREPORT
oRep:bInit := { || nLine := 0 }
oRep:bStartRecord := { || nLine++ }
ACTIVATE REPORT oRep
RELEASE FONT oFont
return nil