In Development
Last Updated: 31 Mar 2025 10:22 by ADMIN
Scheduled for 2025 Q2
Nathan
Created on: 28 Mar 2025 12:41
Type: Bug Report
1
The PDF export of a Table with a PictureBox and enabled accessibility generates a corrupted document

We have reports that contain a table of images. This seems to work great in the designer and when generated to a PDF without accessibility turned on. However, with accessibility turned on and rendering to a PDF, it throws an exception:

System.NullReferenceException: Object reference not set to an instance of an object.
   at Telerik.Reporting.Pdf.PdfAccessibilityElementWriter.TryAttachToParentNode(ProcessingInstanceIdentifier id, PdfOrderedReference element, Int32 rowIndex, Int32 columnIndex)
   at Telerik.Reporting.Pdf.PdfAccessibilityElementWriter.TryAttachToParentNode(IProcessingElement processingElement, IProcessingElement parentProcessingElement, PdfOrderedReference taggedElementReference)
   at Telerik.Reporting.Pdf.PdfAccessibilityElementWriter.AttachNonLeafNode(LayoutElement element, PdfOrderedReference taggedElementReference)
   at Telerik.Reporting.Pdf.PdfAccessibilityElementWriter.InitTaggedElement(AccessibilityPdfElement pdfElementType)
   at Telerik.Reporting.Pdf.PdfAccessibilityElementWriter.AddFigureElement(ITableCell element)
   at Telerik.Reporting.Processing.ProcessingElementVisitor.Visit(LayoutElement element)
   at Telerik.Reporting.Writing.AccessibilityElementWriter.StartWrite(ReportItemBase element, Int32& index)
   at Telerik.Reporting.Writing.VisualElementWriter`1.StartWriteAccessibilityItem(ReportItemBase item, ElementPageInfo pageInfo, DocumentWriter writer)
   at Telerik.Reporting.Writing.VisualElementWriter`1.WriteClientFocusableItems(T element, ElementPageInfo pageInfo, DocumentWriter writer)
   at Telerik.Reporting.Writing.ReportItemBaseWriter`1.StartWrite(T element, ElementPageInfo pageInfo, DocumentWriter writer)
   at Telerik.Reporting.Writing.ElementWriter`1.Telerik.Reporting.Writing.IElementWriter.StartWrite(LayoutElement element, ElementPageInfo pageInfo, DocumentWriter writer)
   at Telerik.Reporting.Writing.WriteOperationsDispatcher.Visit(PictureBox pictureBox)
   at Telerik.Reporting.Processing.ProcessingElementVisitor.Visit(LayoutElement element)
   at Telerik.Reporting.Writing.DocumentWriter.Telerik.Reporting.BaseRendering.IWriter.WriteStartElement(LayoutElement element, ElementPageInfo pageInfo)
   at Telerik.Reporting.Paging.PageElementsLayer.OutputToPage(IPageHandler handler)
   at Telerik.Reporting.Paging.PageContent.Output(IPageHandler handler)
   at Telerik.Reporting.Paging.PageCompositionBase.OutputPageContent(Stopwatch stopwatchOutputContent, PageContent pageContent)
   at Telerik.Reporting.Paging.PageCompositionBase.<>c__DisplayClass124_0.<CreatePageContentOutputTask>b__0()

1 comment
ADMIN
Todor
Posted on: 28 Mar 2025 12:51

Hello Nathan,

The workaround I may suggest is to place the PictureBox item in a Panel rather than directly in the Table cell.

The approach let me generate a PDF with enabled accessibility with the same report that threw the exception when the PictureBox was not in a Panel.

Regards,
Todor
Progress Telerik

Enjoyed our products? Share your experience on G2 and receive a $25 Amazon gift card for a limited time!