System.OperationCanceledException: The operation was canceled. when rendering a report on Mac

1 Answer 285 Views
Rendering
William
Top achievements
Rank 1
Iron
William asked on 16 Sep 2022, 01:55 AM

I have a pretty simple report that shows a couple of fields and a cross tab with some child data. It's just for demo purposes for now. It runs against an object data source, a .NET 6 class and I'm setting the data source at runtime like so:

var reportProcessor = new ReportProcessor(); var reportSourcePath = Path.Combine(_config["reportTemplatePath"], "Test.trdp"); Telerik.Reporting.Report report = null; using (var sourceStream = File.OpenRead(reportSourcePath)) { var reportPackager = new ReportPackager(); report = (Telerik.Reporting.Report) reportPackager.UnpackageDocument(sourceStream); } report.DataSource = GetDataSource(customerId); // Returns a .NET 6 object instance

Rendering the report thusly:

var reportSource = new InstanceReportSource();
reportSource.ReportDocument = report;
var result = reportProcessor.RenderReport("PDF", reportSource, new System.Collections.Hashtable());

This all works on Windows but fails on Mac at the RenderReport line with the following stack trace that I can't quite parse:


System.OperationCanceledException: The operation was canceled.
   at System.Threading.CancellationToken.ThrowOperationCanceledException()
   at System.Threading.ManualResetEventSlim.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.SpinThenBlockingWait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.InternalWaitCore(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.Wait(CancellationToken cancellationToken)
   at Telerik.Reporting.Paging.PageCompositionBase.SeparateThreadOutputBehavior.Finish()
   at Telerik.Reporting.Paging.PageCompositionBase.CreatePages()
   at Telerik.Reporting.Paging.PagerBase.Telerik.Reporting.Paging.IPager.CreatePages(IPageHandler handler, LayoutElement root)
   at Telerik.Reporting.BaseRendering.RenderingExtensionBase.Render(LayoutElement root, Hashtable renderingContext, Hashtable deviceInfo, CreateStream createStreamCallback, EvaluateHeaderFooterExpressions evalHeaderFooterCallback, PageSettings pageSettings)
   at Telerik.Reporting.BaseRendering.RenderingExtensionBase.Render(Report report, Hashtable renderingContext, Hashtable deviceInfo, CreateStream createStreamCallback, EvaluateHeaderFooterExpressions evalHeaderFooterCallback)
   at Telerik.Reporting.Processing.ReportProcessor.RenderCore(ExtensionInfo extensionInfo, IList`1 processingReports, Hashtable deviceInfo, IRenderingContext renderingContext, CreateStream createStreamCallback)
   at Telerik.Reporting.Processing.ReportProcessor.ProcessAndRender(String format, ReportSource reportSource, Hashtable deviceInfo, IRenderingContext renderingContext, CreateStream createStreamCallback)
   at Telerik.Reporting.Processing.ReportProcessor.ProcessAndRenderStateless(String format, ReportSource reportSource, Hashtable deviceInfo, IRenderingContext renderingContext, CreateStream createStreamCallback)
   at Telerik.Reporting.Processing.ReportProcessor.<>c__DisplayClass46_0.<RenderReport>b__0(SingleStreamManager sm)
   at Telerik.Reporting.Processing.ReportProcessor.RenderReportSafe(Func`2 renderCallback, String format, IRenderingContext renderingContext)
   at Telerik.Reporting.Processing.ReportProcessor.RenderReport(String format, ReportSource reportSource, Hashtable deviceInfo, CancellationToken cancellationToken)
   at Telerik.Reporting.Processing.ReportProcessor.RenderReport(String format, ReportSource reportSource, Hashtable deviceInfo)
I had an earlier error that I solved by installing the libgdiplus library but I can't figure out what's causing this. It seems to be related to the paging but to my knowledge, there is no paging in the report. Or at least no obvious paging; I modified it from the Speakers Report sample so maybe there's some lingering there? Either way, I don't know why it's failing on Mac but not Windows.

1 Answer, 1 is accepted

Sort by
0
Accepted
William
Top achievements
Rank 1
Iron
answered on 16 Sep 2022, 02:18 AM
I found the cause of the error. The report used the Microsoft Sans Serif font which isn't available on Mac. When I switched everything to Arial, it rendered as expected.
Tags
Rendering
Asked by
William
Top achievements
Rank 1
Iron
Answers by
William
Top achievements
Rank 1
Iron
Share this question
or