Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Custom print preview form questions
Message
De
14/07/2005 18:26:32
 
 
À
14/07/2005 16:45:08
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01032329
Message ID:
01032853
Vues:
20
Colin,

WOW! Great answers!!!

[ASIDE: For those following this thread, the secret to understanding what Colin is talking about is to study XSOURCE.ZIP's frxpreview.vcx classlib's frxpreviewtoolbar, frxpreviewform classes]

> 1. How to print to a printer given a specific canvas control -AND- 5. Is there a way to have VFP return to the current page in preview mode after a report is printed? With the default preview form, VFP always exits preview mode after being asked to print.

I'm going to use your suggestion of running the report again using a separate report listener, but directed to a printer vs. the preview form. This is a great suggestion(!) - no need for you to research how to pass a GDI handle to another printer. But thanks for the offer!

BTW: I always report from cursors vs. live data so my report content will be the same in both my preview and printed output.

>> 2. Change the zoom factor of my canvas

>To do this accurately requires knowing the DPI of your screen and scaling the shape/container control appropriately. In other words, if your screen is 96dpi and your page is 8.5 x 11 then for 100% zoom your shape must be (8.5x96) by (11x96). Fractional zooms are easy to pull out of that.

I follow your logic. In reading XSOURCE.ZIP, it looks like our report object provides us with page height and width via:
This.oReport.GetPageHeight()
This.oReport.GetPageWidth()
I assume that this is how the print preview sizes the canvas and adjusts for landscape and non-US paper sizes like A4?

XSOURCE also shows the Win32 API calls we can make to get screen DPI:
#define LOGPIXELSX 88
GetDeviceCaps( m.hdc, LOGPIXELSX ) 
This gives us DPI horizontally. What I don't understand is why we don't need to take vertical DPI into account (LOGPIXELSY 90) in our zoom calculations?

After reading your explanation and consulting XSOURCE, it appears that the default collection of zoom levels can be totally customized to whatever percentages we want and not just the list of zoom options held in the ZoomLevels[] array. Does this sound correct?

>> 4. Specify a 2-up page display mode (do I need to add an additional canvas for the 2nd page view?)
>
>It's one canvas/shape per visible page.

If I understand your explanation (and in looking at XSOURCE), there is nothing stopping us (other than performance/system resources) from duplicating the Word 2003 print preview options that provide alternative canvas layouts?
1x1, 1x2, 1x3
2x1, 2x2, 2x3
Conclusion: I'm blown away by the new report engine. It sounds like we can build almost any type of preview functionality we can imagine?

> I hope this helps

Colin, yes, yes, YES! :)

Thank you very much for your help.

Malcolm
Malcolm Greene
Brooks-Durham
mgreene@bdurham.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform