Completed
Last Updated: 13 Apr 2022 14:14 by ADMIN
Release R2 2022
Franz
Created on: 04 Apr 2022 14:21
Category: SpreadProcessing
Type: Bug Report
1
SpreadProcessing: ArgumentException is thrown when importing an XLSX document with a comment (Note) without author

Hello,

An exception is thrown when importing an xlsx file which has a comment that does not have an author. But the author may be null.

System.ArgumentException: 'author'

This exception was originally thrown at this call stack:
    Telerik.Windows.Documents.Spreadsheet.Utilities.Guard.ThrowExceptionIfNullOrEmpty(string, string)
    Telerik.Windows.Documents.Spreadsheet.Model.NoteCollection.Add(Telerik.Windows.Documents.Spreadsheet.Model.CellIndex, Telerik.Windows.Documents.Spreadsheet.Model.CellIndex, string, string)
    Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.Contexts.XlsxWorksheetImportContext.ApplyNoteInfo(Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.Contexts.NoteBase)
    Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.Model.Elements.Comments.CommentElement.OnAfterRead(Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.Import.IXlsxWorksheetImportContext)
    Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.Model.Elements.Comments.CommentsElementBase.OnAfterRead(Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.Import.IXlsxWorkbookImportContext)
    Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Elements.OpenXmlElementBase<TImportContext, TExportContext, TPartsManager>.OnAfterRead(Telerik.Windows.Documents.FormatProviders.OpenXml.Import.IOpenXmlImportContext)
    Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Elements.OpenXmlElementBase.Read(Telerik.Windows.Documents.FormatProviders.OpenXml.IOpenXmlReader, Telerik.Windows.Documents.FormatProviders.OpenXml.Import.IOpenXmlImportContext)
    Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Elements.OpenXmlElementBase.ReadChildElements(Telerik.Windows.Documents.FormatProviders.OpenXml.IOpenXmlReader, Telerik.Windows.Documents.FormatProviders.OpenXml.Import.IOpenXmlImportContext)
    Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Elements.OpenXmlElementBase.Read(Telerik.Windows.Documents.FormatProviders.OpenXml.IOpenXmlReader, Telerik.Windows.Documents.FormatProviders.OpenXml.Import.IOpenXmlImportContext)
    Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Elements.OpenXmlElementBase.ReadChildElements(Telerik.Windows.Documents.FormatProviders.OpenXml.IOpenXmlReader, Telerik.Windows.Documents.FormatProviders.OpenXml.Import.IOpenXmlImportContext)
    ...
    [Call Stack Truncated]

This is the code that can be used to reproduce the issue, according to your documentation:

        Workbook workbook;
        XlsxFormatProvider formatProvider = new XlsxFormatProvider();

        using (Stream input = new FileStream(_path, FileMode.Open))
        {
            workbook = formatProvider.Import(input);
        }

I have attached a document that got a comment without an author.

Attached Files:
2 comments
ADMIN
Peshito
Posted on: 13 Apr 2022 14:14

Hello,

This item will be available in R2 2022 Release. 

It is also available with Telerik UI for WPF's latest internal build - LIB 2022.1.418 (18 Apr 2022) if you need it earlier.

Regards,
Peshito
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

ADMIN
Martin
Posted on: 05 Apr 2022 10:26

Hi Franz,

Thank you for the feedback and for sharing the document with us. This helped me to successfully reproduce the described behavior.

Examining the document it seems the document contains an empty author element that is not successfully imported:

As a side note, if this author element is omitted the document becomes invalid.

I slightly modified this bug report title in order to meet our pattern.

In appreciation for bringing this to our attention, I updated your Telerik points.

Please, continue following this item so you can be notified when its status changes.

Regards,
Martin
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.