Posted 5 November 2024, 10:30 am EST
I upgrade my active reports from 17 to 18 and updated the nuget package dependencies to version 18 as well. I have installed both GrapeCity.ActiveReports.Viewer.Win(18.2.0) and MESCIUS.ActiveReports.Viewer.Win(18.2.0) packages. Both of the last 2 lines result in an error. The first being that PrintExtension does not exist and the second being that SectionDocument does not contain a definition for Print.
public static void PrintReportToPrinter(SectionReport rpt, string printer)
{
try {
rpt.Document.Printer.PrinterName = printer;
rpt.Run(false);
var sectionDocument = rpt.Document;
PrintExtension.Print(sectionDocument, false, false);
sectionDocument.Print(true, true, false);
}
catch (Exception) {
throw;
}
}