cancel
Showing results for 
Search instead for 
Did you mean: 

web printing crystal report hangs on report.PrintOptions.PrinterName

Former Member
0 Kudos

Hello,

I have a report web page that displays a crystal report. I have added a modal popup to allow them to select their printers. When I go to print the report is hangs on the line of rpt.PrintOptions.PrinterName = li.Text. The printer names are added to the list box using a Java applet.

Here is the Sub it is running.

Public Sub PrintReports()

rpt = CType(Session("rpt"), ReportDocument)

For Each li As ListItem In Me.lbPrinters.Items

If li.Selected AndAlso li.Text <> "" Then

rpt.PrintOptions.PrinterName = li.Text

rpt.PrintOptions.PrinterDuplex = CType(Me.cboDuplex.SelectedItem.Value, CrystalDecisions.Shared.PrinterDuplex)

rpt.PrintToPrinter(CInt(Me.txtNumOfCopies.Text), True, CInt(Me.txtPageStartRange.Text), CInt(Me.txtPageRangeEnd.Text))

End If

Next

Me.mpePrint.Hide()

End Sub

Any help would be greatly appreciated.

Thanks,

Patrick

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello,

-Ludek,

I have not tried using the activeX print control. I am not sure how to implement this idea. If you could point me to an example, I would give it a try.

- Adam

I am currently developing on my machine, so my local printers and my server printers are the same. My drop down is populated with the server printers as this solution will be an intranet.

I do plan on leaving the printer icon available on the crystal report toolbar so that the user may print to a local printer. But they will also have the ability to print to multiple printers on the server.

Thanks,

Patrick

former_member183750
Active Contributor
0 Kudos

Sounds like you're trying to implement server side printing in your app. Which is fine, except the CR ActiveX print is client side printing. Just in case you're interested, the way to enable activeX print is to go to the property of the CR viewer and find "PrintMode". It will more than likely be defaulted to PDF. Change that to ActiveX.

Now, back to the issue. This may still be a matter of permissions - essentially what Adam was after. Probably the easiest way to determine that is to use the [Process Monitor|http://technet.microsoft.com/en-ca/sysinternals/bb896645.aspx] utility. Once you have the log, search it for "Access Denied" messages.

Ludek

Answers (2)

Answers (2)

Adam_Stone
Active Contributor
0 Kudos

It is likely trying to find that printer from the web server, and I expect that the printer that they are choosing is not accessible/installed on the web server.

former_member183750
Active Contributor
0 Kudos

Does this work if you use the CR ActiveX print dialog?

I understand you can not populate the dialog from your own drop down, but just wondering if that may do?

Ludek

Follow us on Twitter http://twitter.com/SAPCRNetSup