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))
Any help would be greatly appreciated.
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.
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.
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?
Follow us on Twitter http://twitter.com/SAPCRNetSup