Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you Make Crystal use Printer object settings

Status
Not open for further replies.

MikePro

Programmer
Feb 14, 2002
10
US
I am using VB6 w/crystal7. In VB, I make changes to the printer objext in terms of form size and layout depending on the type of printer. Crystal always prints the report using the printers default settings. Do I have to change the default settings of the printer each time I want to print, and if so, is there an easy way to do that.
 
I had some problems of this sort when I developed the automatic printing part of cViewMANAGER - my report scheduler. Happy to share my solution with you.

If you are printing directly from VB then you can set the printer object and options of the cReport.Printer object directly.

If you use preview with Vb and the RDC it uses the default printer when CR starts, not the reassigned object. VB doesn't change the default printer for all apps, just for the VB app itself, so you are back where you start.

The solution I worked out was to invoke the Printer setup form when the report print button was clicked. The user could then select the printer prior to printing.

In Code, in the report viewer form, in the viewer.PrintButtonCLicked event....
UseDefault=True
cReport.PrinterSetup me.Hwnd

I hope this helps. It took me weeks to find an answer. Editor and Publisher of Crystal Clear
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top