Symptom
- Using Report Application Server (RAS) SDK
- Printing via code results in the error:
Class not registered - CrystalPrintControl
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.Runtime.InteropServices.COMException (0x80040154): Class not registered - CrystalPrintControl
at CrystalDecisions.ReportAppServer.Controllers.PrintOutputControllerClass.PrintReport(PrintReportOptions options)
at Unmanaged_RAS10_CSharp_Printers.frmMain.btnPrintToPrinter_Click(Object sender, EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Environment
- Crystal Reports for Visual Studio 2010
- Visual Studio 2010
Reproducing the Issue
- Use the following code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim ReportDoc As New CrystalDecisions.CrystalReports.Engine.ReportDocument()
Dim ReportClientDoc As ISCDReportClientDocument
Dim poc As PrintOutputController
Dim PrintOps As New PrintReportOptions()
ReportDoc.Load("C:\Crystal\don5.rpt")
ReportClientDoc = ReportDoc.ReportClientDocument
poc = rcd.PrintOutputController
PrintOps.PrinterName = "Microsoft XPS Document Writer"
PrintOps.PrinterDuplex = CrPrinterDuplexEnum.crPrinterDuplexSimplex
PrintOps.NumberOfCopies = 1
poc.PrintReport(PrintOps)
ReportDoc.Close()
ReportDoc.Dispose()
End Sub
2. Compile using 64 bit mode (Note: 32 bit compile works without error)
Cause
- The issue has been escalated for a fix
- Reference: ADAPT01608246
Resolution
- This issue has now been resolved in Crystal Reports Developer for Visual Studio Service Pack 9
Keywords
Crystal Print Control CR2010 2010 CR4VS2010 CR4VS VS2010 NET2010 Crystal Reports for .NET Framework 4.0 crforvs 13 , KBA , BI-DEV-NET-SDK , .NET SDK / COM SDK , Problem