Symptom
- Using the RAS PrintCOntroller (CrystalDecisions.ReportAppServer.Controllers.PrintReportOptions) to print reports
- When the application is compiled as 32 bit, printing works as expected
- When the application is compiled as 64 bit, the error is thrown:
Unregistered interface: ICRReportPrinterPageRange - using RAS PrintControl
- Stack trace:
CrystalDecisions.ReportAppServer.Controllers.ISCRPrintReportOptions.AddPrinterPageRange(Int32 rangeStart, Int32 rangeEnd)
in Xxxxxx.CRPE.CRPEManager.Print(PrintJob pj, PrinterSettings printerSetting, PageSettings pageSetting) in C:\Workarea\Agilis\XSolving.CRPE\CRPEManager.vb:riga 512
Environment
- SAP Crystal Reports, developer version for Microsoft Visual Studio
- Microsoft Visual Studio
Reproducing the Issue
- Use the following code to do direct print to printer:
Try
Dim pDoc = New System.Drawing.Printing.PrintDocument
Dim rasPROpts = New CrystalDecisions.ReportAppServer.Controllers.PrintReportOptions
Dim printLayout = New CrystalDecisions.Shared.PrintLayoutSettings
Dim rptClientDoc As CrystalDecisions.ReportAppServer.ClientDoc.ISCDReportClientDocument
rptClientDoc = pj.ReportDocument.ReportClientDocument
rasPROpts.JobTitle = pj.ReportTitle
rasPROpts.PaperSize = pagesetting.PaperSize.RawKind
rasPROpts.PrinterName = printersetting.PrinterName
rasPROpts.NumberOfCopies = printersetting.Copies
rasPROpts.Collated = printersetting.Collate
rasPROpts.PaperSource = Convert.ToInt16(pagesetting.PaperSource.RawKind)
rasPROpts.PrinterDuplex = printersetting.Duplex
rasPROpts.PrinterName = printersetting.PrinterName
rasPROpts.AddPrinterPageRange(printerSetting.FromPage, printerSetting.ToPage)
rptClientDoc.PrintOutputController.PrintReport(rasPROpts)
Catch ex As Exception
Agilis.ShowMessage(ex.Message, Windows.MessageBoxButton.OK, Windows.MessageBoxImage.Error)
End Try
Cause
- The code depends on the PrintControll.dll
- The dll is an ActiveX and has not been updated to 64 bit
Resolution
This issue is resolved in Service Pack 6 for 'SAP Crystal Reports, developer version for Microsoft Visual Studio'
Keywords
crvs cr4vs 2010 2012 print controller controler VS .NET dot , KBA , BI-DEV-NET-SDK , .NET SDK / COM SDK , Problem
Product
SAP Crystal Reports, developer version for Microsoft Visual Studio