Sunday, March 11, 2012

CR10 ActiveX print orientation

Does anyone know how to set the page orientation of the print dialog on the users machine at runtime? Is it possible?
i.e. if you create a CR with landscape layout and the users default print setup is portrait the report will not print correctly.You need to define something called :

crep.PaperOrientation = 2 ; //crDefaultPaperOrientation

Where

crDefaultPaperOrientation= 0
crLandscape= 2
crPortrait = 1

Goto Crystal reports'd developer help and search for PaperOrientation or CRPaperOrientation :

Printer Settings
This application (some demo application) demonstrates how to change the report printer settings at runtime using code.

There are four new report properties that allow you to easily retrieve and set PaperSize, PaperOrientation, PaperSource, and PrinterDuplex for the report printer options. All of these are demonstrated.
There is also a new method called PrinterSetup that provides a Windows standard printer setup window to allow the user to change the printer properties directly at runtime. This is demonstrated as well.
The two methods are independent of each other. For example, changing the Windows standard printer setup will not alter the report printer settings and vice-versa. These new properties and the new method give you much more control over how the report is printed.


Thanks

:wave:

No comments:

Post a Comment