Hello,
I have an ASP.Net Core 3.1 application and have referenced Syncfusion.XlsIO.Net.Core 20.4.0.38 and
Syncfusion.XlsIORenderer.Net.Core 20.4.0.38 along with Syncfusion.Pdf.Net.Core 20.4.0.38.
When I try to open an excel document that contains charts from disk with the application.Workbooks.Open(FileStream) method, I get a NullReference exception. However, when I do the same with an excel document without charts, everything works fine.
The Stack trace is as follows :
at Syncfusion.XlsIO.Implementation.XmlSerialization.Charts.ChartParserCommon.ParseParagraphRunProperites(XmlReader reader, IInternalChartTextArea textArea, Excel2007Parser parser, TextSettings defaultSettings)
at Syncfusion.XlsIO.Implementation.XmlSerialization.Charts.ChartParserCommon.ParseParagraphRun(XmlReader reader, IInternalChartTextArea textArea, Excel2007Parser parser, TextSettings defaultSettings, List`1 tRuns)
at Syncfusion.XlsIO.Implementation.XmlSerialization.Charts.ChartParserCommon.ParseParagraphs(XmlReader reader, IInternalChartTextArea textArea, Excel2007Parser parser, Nullable`1 defaultFontSize, List`1 tRuns, IInternalChartTextArea defaultTextArea)
at Syncfusion.XlsIO.Implementation.XmlSerialization.Charts.ChartParserCommon.ParseRichText(XmlReader reader, IInternalChartTextArea textArea, Excel2007Parser parser, Nullable`1 defaultFontSize, List`1 tRuns, Boolean isRichTextStreamRecord)
at Syncfusion.XlsIO.Implementation.XmlSerialization.Charts.ChartParserCommon.ParseTextAreaText(XmlReader reader, IInternalChartTextArea textArea, Excel2007Parser parser, Nullable`1 defaultFontSize)
at Syncfusion.XlsIO.Implementation.XmlSerialization.Charts.ChartParserCommon.ParseTextAreaTag(XmlReader reader, IInternalChartTextArea textArea, RelationCollection relations, FileDataHolder holder, Nullable`1 defaultFontSize)
at Syncfusion.XlsIO.Implementation.XmlSerialization.Charts.ChartParserCommon.ParseTextArea(XmlReader reader, IInternalChartTextArea textArea, FileDataHolder holder, RelationCollection relations, Nullable`1 defaultFontSize)
at Syncfusion.XlsIO.Implementation.XmlSerialization.Charts.ChartParserCommon.ParseChartTitleElement(Stream titleAreaStream, IInternalChartTextArea textArea, FileDataHolder holder, RelationCollection relations, Single fontSize)
at Syncfusion.XlsIO.Implementation.XmlSerialization.Charts.ChartParser.ParseChartElement(XmlReader reader, ChartImpl chart, RelationCollection relations)
at Syncfusion.XlsIO.Implementation.XmlSerialization.Charts.ChartParser.ParseChart(XmlReader reader, ChartImpl chart, RelationCollection relations)
at Syncfusion.XlsIO.Implementation.XmlReaders.Excel2007Parser.ParseChartTag(XmlReader reader, ChartImpl chart, RelationCollection relations, FileDataHolder dataHolder, String itemName, Boolean isChartEx)
at Syncfusion.XlsIO.Implementation.XmlReaders.Excel2007Parser.TryParseChart(MemoryStream data, WorksheetBaseImpl sheet, String drawingPath, Boolean isChartEx)
at Syncfusion.XlsIO.Implementation.XmlReaders.Excel2007Parser.ParseTwoCellAnchor(XmlReader reader, WorksheetBaseImpl sheet, String drawingsPath, List`1 lstRelationIds, Dictionary`2 dictItemsToRemove, Boolean isChartShape)
at Syncfusion.XlsIO.Implementation.XmlReaders.Excel2007Parser.ParseDrawings(XmlReader reader, WorksheetBaseImpl sheet, String drawingsPath, List`1 lstRelationIds, Dictionary`2 dictItemsToRemove, Boolean isChartShape)
at Syncfusion.XlsIO.Implementation.XmlSerialization.WorksheetDataHolder.ParseDrawings(WorksheetBaseImpl sheet, Relation drawingRelation, Dictionary`2 dictItemsToRemove, Boolean isChartShape)
at Syncfusion.XlsIO.Implementation.XmlSerialization.WorksheetDataHolder.ParseDrawings(WorksheetBaseImpl sheet, String relationId, Dictionary`2 dictItemsToRemove)
at Syncfusion.XlsIO.Implementation.XmlReaders.Excel2007Parser.ParseDrawings(XmlReader reader, WorksheetBaseImpl sheet, Dictionary`2 dictItemsToRemove)
at Syncfusion.XlsIO.Implementation.XmlReaders.Excel2007Parser.ParseAfterSheetData(XmlReader reader, WorksheetImpl sheet, MemoryStream& streamCF, String strParentPath, Dictionary`2 dictItemsToRemove)
at Syncfusion.XlsIO.Implementation.XmlSerialization.WorksheetDataHolder.ParseWorksheetData(WorksheetImpl sheet, Dictionary`2 dictUpdateSSTIndexes, Boolean parseOnDemand)
at Syncfusion.XlsIO.Implementation.WorksheetImpl.ParseData(Dictionary`2 dictUpdatedSSTIndexes)
at Syncfusion.XlsIO.Implementation.XmlReaders.Excel2007Parser.ParseWorksheets(Dictionary`2 dictUpdatedSSTIndexes, Boolean parseOnDemand)
at Syncfusion.XlsIO.Implementation.XmlSerialization.FileDataHolder.ParseWorkbook(List`1& themeColors, Boolean parseOnDemand)
at Syncfusion.XlsIO.Implementation.XmlSerialization.FileDataHolder.ParseDocument(List`1& themeColors, Boolean parseOnDemand)
at Syncfusion.XlsIO.Implementation.WorkbookImpl.ParseExcel2007Stream(Stream stream, String password, Boolean parseOnDemand)
at Syncfusion.XlsIO.Implementation.WorkbookImpl.ParseStream(Stream stream, String password, ExcelVersion version, ExcelParseOptions options)
at Syncfusion.XlsIO.Implementation.WorkbookImpl..ctor(IApplication application, Object parent, Stream stream, ExcelParseOptions options, ExcelVersion version)
at Syncfusion.XlsIO.Implementation.ApplicationImpl.CreateWorkbook(Object parent, Stream stream, ExcelVersion version, ExcelParseOptions options)
at Syncfusion.XlsIO.Implementation.Collections.WorkbooksCollection.Open(Stream stream, ExcelVersion version, ExcelParseOptions options)
at Syncfusion.XlsIO.Implementation.Collections.WorkbooksCollection.Open(Stream stream, ExcelVersion version)
at Syncfusion.XlsIO.Implementation.Collections.WorkbooksCollection.Open(Stream stream, ExcelOpenType openType)
at Syncfusion.XlsIO.Implementation.Collections.WorkbooksCollection.Open(Stream stream)
at ... My calling Code
Please help me out.
Thanks,
Nikhil Navare
Hi Nikhil,
We suspect the issue to be file specific and request that you share the input Excel document you are using at your end so we can investigate the query further.
If you are not comfortable sharing the document here in public, you can send it to [email protected] through email, mentioning the forum link.
Regards,
Keerthi.
Hello Keerthi,
I have sent the file to the email id provided above.
Please do the needful.
Regards,
Nikhil
Nikhil, thanks for sharing the Excel document as requested. We request you to follow the support ticket created under your account, for further updates regarding this query.