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 Chris Miller 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 change the Printer

Status
Not open for further replies.

iannuzzelli

Programmer
Jan 4, 2003
36
US
Can someone show me how I can change the printer for the Crystal Viewer using VB code?

I have multiple printers and would like to use any of them to print. For some reason it will not recognize the changes within VB.

 
In the old days we used:

crReport.SelectPrinter "drivername", "printername", "port"

Not sure if that's the current means, perhaps Ken or some other current VB sort will come along and clarify.

Using .net:

MyReport.PrinterOptions.PrinterName = "MyPrinter"

-k kai@informeddatadecisions.com
 
I assume you want your user to select the printer from inside the viewer when the report is being previewed.

You need to trap the Print Button Clicked event.

Private Sub CRView_PrintButtonClicked _
(UseDefault As Boolean)
UseDefault = True
cReport.PrinterSetup Me.hwnd
End Sub

This requires the Print Button to be enabled inside the viewer. Editor and Publisher of Crystal Clear
 
Thanks for the help! Now I need to figure out how to change the viewer to reflect the options I choose in the printer properties. I have some research to do.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top