Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Thinking outside the box
Message
From
13/05/1999 16:29:06
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00217920
Message ID:
00218658
Views:
24
>How do you do it?

I didn't do it. Honest!

Just kidding.

Create a blank form (this can be done programattically in the same code that shows the preview, but I use it so much I have it predefined to save time.) Make the form a child of the top-level form. When you preview the report, preview it into the form, like this....
*   Method PrintReport()
LPARAMETER llPrint

IF llPrint  && Send report to printer
    REPORT FORM myReport TO PRINT PROMPT NOCONSOLE
ELSE  && preview the report

    *-- Instantiate the report screen
    DO FORM myPreview NAME oPreview LINKED

    IF TYPE("oPreview") = "O" .AND. !ISNULL(oPreview)
	WITH oPreview
            .showwindow = 1 && in top level form
	    .caption = "My Caption"
            .windowstate = 2 && maximized
	    .visible = .T.
	    REPORT FORM myReport PREVIEW WINDOW "myPreview"
	    .release()
	ENDWITH
    ELSE
	REPORT FORM myReport PREVIEW
    ENDIF
ENDIF

RETURN
That's all there is to it.

In your situation, where you have a tiny top-level form. You will probably have to add code to maximize the TLForm before displaying myPreview, then return the TLForm to its normal state when the preview closes.

Hope this helps, let me know how you make out.

regards,
Jim Edgar
Jurix Data Corporation
jmedgar@yahoo.com

No trees were destroyed in sending this message. However, a large number of electrons were diverted from their ordinary activities and terribly inconvenienced.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform