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

Getting access to a detailed printer dialog?

Status
Not open for further replies.

sussan

Programmer
Oct 13, 2000
1
SE
When printing a Crystal Reports report from an application (C++) I would like to get a printer dialog like the one you get using ctrl-P i Word. (When you get the opportunity to change printer options like paper tray). Does anyone know if this is possible?
[sig][/sig]
 
Funny you should ask this. After much digging, I just found the answer to this. My answer though, was for Visual Basic 6. Maybe this will help you find a corresponding answer for C++.

In VB6, the syntax is:

ReportObject.PrintWindowOptions.HasPrintSetupButton = True

From this you get a window that allows the user to select a printer as well as which tray to print from. I did discover that it will only display the options that have already been setup in the printer's properties. If Tray 2 has not been setup as an option to print from in the printer's property screen, then it won't show up in the list of options within Crystal Reports list options.

Hope this helps.
[sig]<p>Keoki<br><a href=mailto:gb@cardinalhill.org>gb@cardinalhill.org</a><br><a href= > </a><br> [/sig]
 
If printing directly (IE: Not showing the viewer) use this code

Report.PrinterSetup Me.hWnd
report.printout

if using the viewer use this code:

Private Sub CRViewer1_PrintButtonClicked(UseDefault As Boolean)
Report.PrinterSetup Me.hWnd
CRViewer1.PrintReport
End Sub


where Report is the report object set in your form_load event and where CRViewer1 is the CRViewer control on your form.

Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top