Hi,
We have a threaded service where we export excel documents to PDF documents (using Telerik.Windows.Documents.Spreadsheet.FormatProviders.Pdf.PdfFormatProvider.Export) and then merge the PDF with other PDF documents (using Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfFormatProvider.Import and RadFixedDocument.Merge). We make sure to dispose the Workbook of the excel document and the MemoryStream from exporting to PDF.
After some time we start getting the following error, until we restart the service.
One or more errors occurred.
at System.Threading.Tasks.Task.WaitAll(Task[] tasks, Int32 millisecondsTimeout, CancellationToken cancellationToken)
at Telerik.Windows.Documents.Utilities.TasksHelper.DoAsync(Action[] actions)
at Telerik.Windows.Documents.Spreadsheet.Layout.RadWorksheetLayout.CalculateCellContentSizes(List`1 cellsToCalculateContentSize, CellProperties[] cellsFontProperties)
at Telerik.Windows.Documents.Spreadsheet.Layout.RadWorksheetLayout.UpdateCellContentSizesCache()
at Telerik.Windows.Documents.Spreadsheet.Layout.RadWorksheetLayout.Measure()
at Telerik.Windows.Documents.Spreadsheet.Model.Workbook.UpdateWorksheetLayout(RadWorksheetLayout worksheetLayout, Worksheet worksheet, Boolean isForPrinting)
at Telerik.Windows.Documents.Spreadsheet.Model.Shapes.ShapeCollection.GetTopLeftPoint()
at Telerik.Windows.Documents.Spreadsheet.Model.Shapes.ShapeCollection.GetTopLeftCellIndex()
at Telerik.Windows.Documents.Spreadsheet.Model.Shapes.ShapeCollection.RecalculateUsedCellRange()
at Telerik.Windows.Documents.Spreadsheet.Model.Worksheet.get_TotalUsedCellRange()
at Telerik.Windows.Documents.Spreadsheet.Layout.PageLayout.AddPages(Worksheet worksheet, Boolean ignorePrintArea)
at Telerik.Windows.Documents.Spreadsheet.Layout.PageLayout.PreparePages(Workbook workbook, Boolean ignorePrintArea)
at Telerik.Windows.Documents.Spreadsheet.FormatProviders.Pdf.PdfFormatProvider.ExportOverride(Workbook workbook, Stream output)
...
...
Inner exception: The operation completed successfully
at MS.Win32.UnsafeNativeMethods.RegisterClassEx(WNDCLASSEX_D wc_d)
at MS.Win32.HwndWrapper..ctor(Int32 classStyle, Int32 style, Int32 exStyle, Int32 x, Int32 y, Int32 width, Int32 height, String name, IntPtr parent, HwndWrapperHook[] hooks)
at System.Windows.Threading.Dispatcher..ctor()
at System.Windows.Threading.Dispatcher.get_CurrentDispatcher()
at System.Windows.Media.TextFormatting.TextFormatter.FromCurrentDispatcher(TextFormattingMode textFormattingMode)
at System.Windows.Media.FormattedText.LineEnumerator..ctor(FormattedText text)
at System.Windows.Media.FormattedText.DrawAndCalculateMetrics(DrawingContext dc, Point drawingOffset, Boolean getBlackBoxMetrics)
at System.Windows.Media.FormattedText.get_Metrics()
at Telerik.Windows.Documents.Core.TextMeasurer.RadTextMeasurer.MeasureTextWithWrapping(TextProperties textProperties, FontProperties fontProperties, Double wrappingWidth)
at Telerik.Windows.Documents.Spreadsheet.Measurement.RadTextMeasurer.Measure(String text, FontProperties fontProperties, Nullable`1 wrappingWidth)
at Telerik.Windows.Documents.Spreadsheet.Measurement.RadTextMeasurer.MeasureMultiline(String text, FontProperties fontProperties, Nullable`1 wrappingWidth)
at Telerik.Windows.Documents.Spreadsheet.Layout.LayoutHelper.DefaultTextMeasuringMethod(String text, FontProperties fontProperties, Nullable`1 wrappingWidth)
at Telerik.Windows.Documents.Spreadsheet.Layout.LayoutHelper.CalculateCellContentSize(ICellValue cellValue, CellValueFormat format, FontProperties fontProperties, Double cellIndent, Nullable`1 wrappingWidth, Func`4 measureMultilineText)
at Telerik.Windows.Documents.Spreadsheet.Layout.RadWorksheetLayout.<>c__DisplayClass4.<
CalculateCellContentSizes
>b__1()
at System.Threading.Tasks.Task.Execute()
Any help on why this happens and how we can fix it would be appreciated.