Cannot print Crystal reports to any printer from VB.NET

B

Bill Nguyen

I'm getting this error message trying to print to any networked printer:

"Analysis Server: Invalid printer specified"

This just happened today!

I had no problem printing to these printers from Crystal report (in
VB.NET) before using the following codes:


Private Function AddPrinters()

Dim prtdoc As New PrintDocument

Dim strDefaultPrinter As String = prtdoc.PrinterSettings.PrinterName

Dim strPrinter As [String]

For Each strPrinter In PrinterSettings.InstalledPrinters

cbPrinter.Items.Add(strPrinter)

If strPrinter = strDefaultPrinter Then

cbPrinter.SelectedIndex = cbPrinter.Items.IndexOf(strPrinter)

End If

Next strPrinter

End Function


mprinterName = Trim(cbPrinter.Text)



myReport.RecordSelectionFormula = mSelection

myReport.PrintOptions.PrinterName = mprintName

myReport.PrintToPrinter(1, True, 0, 0)



Thanks



Bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top