Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't open specific file that contains pivot tables #2498

Open
3 of 6 tasks
viogroza opened this issue Nov 13, 2024 · 1 comment
Open
3 of 6 tasks

Can't open specific file that contains pivot tables #2498

viogroza opened this issue Nov 13, 2024 · 1 comment

Comments

@viogroza
Copy link

viogroza commented Nov 13, 2024

Read and complete the full issue template

Do not randomly delete sections. They are here for a reason.

Do you want to request a feature or report a bug?

  • Bug
  • Feature
  • Question

Did you test against the latest CI build?

  • Yes
  • No

If you answered No, please test with the latest development build first.

Version of ClosedXML

0.104.1, latest develop (as of 13 Nov 2024)
the problem seems to be introduced in 0.102.1

What is the current behavior?

Unable to open the attached xlsx file

What is the expected behavior or new feature?

Attached xlsx file should open properly

Is this a regression from the previous version?

It's a regression introduced in 0.102.1.0
In 0.100.3 opening the file worked

Reproducibility

This is an important section. Read it carefully. Failure to do so will cause a 'RTFM' comment.

Open the attached file. The stack trace is
Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
at ClosedXML.Excel.IO.PivotTableCacheDefinitionPartReader.ParsePivotSourceReference(PivotTableCacheDefinitionPart pivotTableCacheDefinitionPart)
at ClosedXML.Excel.IO.PivotTableDefinitionPartReader.<>c__DisplayClass1_0.b__1(XLPivotCache ps)
at System.Linq.Enumerable.TryGetFirst[TSource](IEnumerable1 source, Func2 predicate, Boolean& found)
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable1 source, Func2 predicate)
at ClosedXML.Excel.IO.PivotTableDefinitionPartReader.Load(WorkbookPart workbookPart, Dictionary`2 differentialFormats, PivotTablePart pivotTablePart, WorksheetPart worksheetPart, XLWorksheet ws, LoadContext context)
at ClosedXML.Excel.XLWorkbook.LoadSpreadsheetDocument(SpreadsheetDocument dSpreadsheet)
at ClosedXML.Excel.XLWorkbook.LoadSheets(String fileName)
at ClosedXML.Excel.XLWorkbook.Load(String file)
at ClosedXML.Excel.XLWorkbook..ctor(String file, LoadOptions loadOptions)
at ClosedXML.Excel.XLWorkbook..ctor(String file)
at Program.

$(String[] args) in C:

image

I noticed that there are a few similar reported issues, but they don't have any excel file attached
#2309
#2063

This one is is also similar, has attachment but the problem is solved on latest develop
#2272

The crash reported by this ticket is still happening on latest develop (as of 13 Nov 2024)

Code to reproduce problem:

public void Main()
{
  //See attached sample below, it should reproduce the problem
   using var a = new XLWorkbook(fileName);
}
@mcastillob
Copy link

Hi,

The problem is with the external cache. There is no support apparently. The error occurs in these cases.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants