Unplanned
Last Updated: 16 Jun 2023 10:22 by ADMIN
Lars Erik
Created on: 09 Jun 2023 13:06
Category: SpreadProcessing
Type: Bug Report
3
SpreadProcessing: ArgumentNullException when importing a document with a conditional formatting rule with no borders

When opening an Xlsx file with conditional formatting I get an Exception:

"System.ArgumentNullException: 'Value cannot be null. (Parameter 'formatting')'

at Telerik.Windows.Documents.Spreadsheet.Model.ConditionalFormattings.ConditionalFormattingDxfRule..ctor(DifferentialFormatting formatting)
   at Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.Model.Elements.Worksheets.ConditionalFormattingRuleElement.GetRule(DifferentialFormatting formatting)
   at Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.Model.Elements.Worksheets.ConditionalFormattingRuleElement.OnAfterRead(IXlsxWorksheetImportContext context)
   at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Elements.OpenXmlElementBase.ReadChildElements(IOpenXmlReader reader, IOpenXmlImportContext context)
   at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Elements.OpenXmlElementBase.Read(IOpenXmlReader reader, IOpenXmlImportContext context)
   at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Elements.OpenXmlElementBase.ReadChildElements(IOpenXmlReader reader, IOpenXmlImportContext context)
   at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Elements.OpenXmlElementBase.Read(IOpenXmlReader reader, IOpenXmlImportContext context)
   at Telerik.Windows.Documents.FormatProviders.OpenXml.OpenXmlImporter`1.ImportPartFromArchive(ZipArchiveEntry zipEntry, PartBase part, IOpenXmlImportContext context)
   at Telerik.Windows.Documents.FormatProviders.OpenXml.OpenXmlImporter`1.Import(Stream input, IOpenXmlImportContext context)
   at Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.XlsxFormatProvider.ImportOverride(Stream input)
   at WpfApp1.MainWindow.StartExcel() in C:\Users\larse\source\repos\WpfApp1\MainWindow.xaml.cs:line 49"

To quote my colleage: "After dissecting the Excel template file, I have isolated what is causing the issue. If conditional formatting is used to disable cell boarders it results in the error, if the conditional formatting is updated to turn the necessary borders white, instead of disabling the report exports correctly, the following screenshot also explains."

2 comments
ADMIN
Yoan
Posted on: 16 Jun 2023 10:22

Hello Lars,

Thank you for the detailed description of the case. I managed to reproduce the borders rule issue which you can view in our Feedback Portal: SpreadProcessing: ArgumentNullException when importing a document with a conditional formatting rule with no borders. If you'd like you can subscribe to the task to track its progress and receive notifications for any possible status updates.

I apologize for the inconvenience but I cannot offer you a workaround for this scenario. As a thank you for bringing this up to us, I have also updated your Telerik Points.

And Chris, as far as the second trigger you have come across, I was unable to reproduce anything similar. Would you be able to share with us a sample document containing the conditional formatting that looks for the '<' and '>' symbols so I can examine it and get back to you? As per our EULA section 11 everything you share is confidential and used only for testing, so rest assured.

Looking forward to your reply.

Regards,
Yoan
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.

Chris
Posted on: 15 Jun 2023 22:59

Hi, I am the colleague Lars refers to in the ticket above. I wanted to add, we have isolated another trigger for the error, again relating to certain conditional formatting, if looking for text strings containing the greater than > or less than symbols <, it results in the same error / exception.

Regards

Chris Murray