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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printer Setup

Status
Not open for further replies.

elibb

Programmer
Oct 22, 2001
335
0
0
MX
hi.. i have a vb6.0 application, and im making a report in CR8.0.
how can i give the user the choice to choose the printer to print the report??
thank You

Eli
 
Create the report using your default printer. Then when run by the user the report will default to their default printer
 
Hi!

Try using VB's common dialog control (CommonDialog.ShowPrinter) to choose printer, paper size et cetera, and the set the printer like this:

YourReport.ReportDesignerVar.SelectPrinter(Printer.DriverName, Printer.DeviceName, Printer.Port)
YourReport.PaperSize = Printer.PaperSize
YourReport.PaperOrientation = Printer.Orientation
YourReport.PrintOut False ' false = don't prompt user

Regards
Michael
 

If you're using the OCX, just set the right property to TRUE:

CrystalReport1.WindowShowPrintSetupBtn = True

If you're using the RDC, unfortunately they've gone backward and you need to use the VB Common Dialog control.
 
Michel Hu:

i tried what you told me, but it didnt work.. im not sure of what im doing wrong, in the line: YourReport.ReportDesignerVar.SelectPrinter(Printer.DriverName, Printer.DeviceName, Printer.Port)
it said that there is a = missing...
can you help me??

thank you very much

Eli
 
Hai Friend
in cr there is a property windowprintersetup.expose this property in ur code.

eg: cr.windowsprintersetup=true

using this u can select ur printer during the time u view ur report (run time).

this windowsprintersetup opens the same window that u choose while selecting ur printer setup in design time
i think this should help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top