Hi all,
While trying to print a report, this exception is raised. Here's the code we use:
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
Obviously the fault happens in:
rasPROpts.AddPrinterPageRange(printerSetting.FromPage, printerSetting.ToPage)
The stack trace is:
in CrystalDecisions.ReportAppServer.Controllers.ISCRPrintReportOptions.AddPrinterPageRange(Int32 rangeStart, Int32 rangeEnd) in XSolving.CRPE.CRPEManager.Print(PrintJob pj, PrinterSettings printerSetting, PageSettings pageSetting) in C:\Workarea\Agilis\XSolving.CRPE\CRPEManager.vb:riga 512
We're using the last available version of CR for VS (13.0.5).
I already tried to uninstall and reinstall both Crystal Reports for Visual Studio and the 64-bit Runtime engine, but nothing has changed.