* Create the listener and tell it to use the preview window. r1 = newobject("_ReportListener", HOME()+"\ffc\_REPORTLISTENER.vcx") r1.ListenerType = 3 * Run the report. REPORT FORM ".\report\receipt1.frx" OBJECT r1 DO FORM ".\form\f_record_preview.scx" f_record_preview.listener = r1 f_record_preview.pageno = 1 f_record_preview.receiptno = rNO f_record_preview.Caption = "Receipt Preview of "+ cNum +" - Page " + trans(f_record_preview.PageNo)+" of "+ TRANSFORM(f_record_preview.listener.pagetotal) f_record_preview.refreshMETHOD::OutputPage
LPARAMETERS nPageNo, eDevice, nDeviceType, nLeft, nTop, nWidth, nHeight, nClipLeft, nClipTop, nClipWidth, nClipHeight with THIS if not isnull(.Listener) and .Listener.PageTotal > 0 .Listener.OutputPage( ; .PageNo, .Frame.Canvas, 2, ; 0, 0 , 0 , 0 , ; .Frame.Left +2, ; .Frame.Top +2, ; .Frame.Width -4, ; .Frame.Height -4 ) this.backCMD.Enabled = IIF(.listener.pagetotal<=1 or .listener.pageno = 1,.F.,.T.) this.nextCMD.Enabled = IIF(.listener.pagetotal<=1 or .listener.pageno = .listener.pagetotal,.F.,.T.) endif endwithZoom in Button
with THISFORM.Frame.Canvas .Width = int(.Width * 1.2) .Height = int(.Height * 1.2) endwith THISFORM.OutputPage()