Navigation: Language Reference > App C - PROP: Runtime Properties > Complete Property List >====== PROP:FlushPreview ====== | |
Flushes the REPORT structure's PREVIEW attribute metafiles to the printer (0 = off, else on, always 0 at report open).
Example:
SomeReport PROCEDURE
WMFQue QUEUE !Queue to contain .WMF filenames
STRING(64)
END
NextEntry BYTE(1) !Queue entry counter variable
Report REPORT,PREVIEW(WMFQue) !Report with PREVIEW attribute
DetailOne DETAIL
!Report controls
END
END
ViewReport WINDOW('View Report'),AT(0,0,320,200),MDI,MAX,HVSCROLL
IMAGE(),AT(0,0,320,180),USE(?ImageField)
BUTTON('View Next Page'),AT(0,180,60,20),USE(?NextPage),DEFAULT
BUTTON('Print Report'),AT(80,180,60,20),USE(?PrintReport)
BUTTON('Exit Without Printing'),AT(160,180,60,20),USE(?ExitReport)
END
CODE
OPEN(Report)
SET(SomeFile) !Code to generate the report
LOOP
NEXT(SomeFile)
IF ERRORCODE() THEN BREAK.
PRINT(DetailOne)
END
ENDPAGE(Report)
OPEN(ViewReport) !Open report preview window
GET(WMFQue,NextEntry) !Get first queue entry
?ImageField{PROP:text} = WMFQue !Load first report page
ACCEPT
CASE ACCEPTED()
OF ?NextPage
NextEntry += 1 !Increment entry counter
IF NextEntry > RECORDS(WMFQue) !Check for end of report
CYCLE
END
GET(WMFQue,NextEntry) !Get next queue entry
?ImageField{PROP:text} = WMFQue !Load next report page
DISPLAY ! and display it
OF ?PrintReport
Report{PROP:FlushPreview} = 1 !Flush files to printer
BREAK ! and exit procedure
OF ?ExitReport
BREAK !Exit procedure
END
END
CLOSE(Report)
CLOSE(Window)
RETURN ! Return to caller, automatically
! freeing the queue and automatically
! deleting all the temporary .WMF files