471,897 Members | 1,983 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,897 software developers and data experts.

Sending Crystal Report to Network Print Mailbox While Bypassing Crystal Report Viewer.

Hello, I am developing a VB.NET 2003 application that will use lots of
Crystal Reports. Sometimes the users will preview a report in a
Crystal report viewer, and sometimes they will send the report directly
to the printer bypassing the Crystal report viewer altogether.

When sending the job directly to the printer I use the PrintToPrinter

CR.PrintToPrinter(1, False, 0, 0)

This works fine when printing right away those reports.

My biggest problem right now is that sometimes the users won't need
to print the report right away and will they send it to the network
printer mailboxes and stored it there until they're ready to print the

What I need is to show the Print Dialog so they can choose the network
printer (Canon ImageRunner 8500) and then the mailbox number in which
to store the report.

I am aware that the main reason of using the PrintToPrinter option is
to stop any print popup screen from showing and print and be done.
However, I do need to show the print dialog so they can have the
ability to either print right away or store the report.

If the report is previewed first and need to be stored in a printer
mailbox right after, it can be done by clicking the print icon from the
Crystal Report Viewer toolbar. The print dialog does show and work.

Can anyone help me with this?

This is a slimmed version of the code of my Print/Preview button. I
have to add report parameters, headers, signatures, etc., but that's
working perfectly, so I did not pasted it here.

'Declare variables
Dim ConnString, Prntr As String
ConnString =
CType(ConfigurationSettings.AppSettings("ConnStrin g"), String)
Prntr = CType(ConfigurationSettings.AppSettings("PrntrName "),
Dim cnn01 As New SqlClient.SqlConnection(ConnString)

'set the report path
Dim RptPath As String
RptPath = FldLocation & RptToPrint

' create a new temporary copy of the selected report
Dim CR As New ReportDocument
Dim crSection As Section
Dim crReportObject As ReportObject
CR.Load(RptPath, OpenReportMethod.OpenReportByTempCopy)
' Either print or preview the report
Select Case PrintDoc
Case "Prnt"

' Check whether to print in landscape or not
Select Case Lndscp
Case True
' Set report to print in landscape
CR.PrintOptions.PaperOrientation =
End Select
' get the printer name from which to print the report
'CR.PrintOptions.PrinterName = Prntr
' print the report
CR.PrintToPrinter(1, False, 0, 0)
Case "Prv"
' Preview the report in the Crystal Report Viewer
CRViewer1.ReportSource = CR
End Select

Thanks for taking your time and see if you can provide any help.

Jan 17 '07 #1
0 2761

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Jeannette | last post: by
3 posts views Thread by Robert Schuldenfrei | last post: by
5 posts views Thread by Robert Schuldenfrei | last post: by
1 post views Thread by codepuller | last post: by
2 posts views Thread by MadCrazyNewbie | last post: by
17 posts views Thread by Peter Proost | last post: by
reply views Thread by YellowAndGreen | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.