Skip to Content
0
Former Member
Jul 23, 2010 at 12:56 PM

web printing crystal report hangs on report.PrintOptions.PrinterName

342 Views

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