Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Mangnifier tool in Report Preview
Message
From
19/07/2006 03:38:42
Aaron K. Y. Chu
Health & Care Co. Ltd.
Hong Kong, Hong Kong
 
 
To
19/07/2006 03:22:11
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01137506
Message ID:
01137509
Views:
14
Dear Jig,

In fact this is copying from someone else works, the report preview in UT. A shape called "canvas" to display the preview obj, and canvas is contained in a container called "frame"..., by modify the size of "canvas", you can zoom in/out... of course, you can incorporate mouse-wheel event,too.

To preview a report in another form
* 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.refresh
METHOD::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
endwith
Zoom in Button
with THISFORM.Frame.Canvas
	.Width  = int(.Width * 1.2)
	.Height = int(.Height * 1.2)
endwith
THISFORM.OutputPage()
Best regards,

Aaron Chu

********************************************************

Working with Visual FoxPro is a lot of FUN!

********************************************************
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform