nissl-lab / npoi

a .NET library that can read/write Office formats without Microsoft Office installed. No COM+, no interop.
Apache License 2.0
5.74k stars 1.44k forks source link

GetExplicitTableStyle throwing a KeyNotFoundException makes all the PivotTable tests fail #1437

Closed divay-ironsoftware closed 4 weeks ago

divay-ironsoftware commented 1 month ago

NPOI Version

Latest Master

File Type

Upload the Excel File

Please attach your original Excel File to help us reproduce the issue

Reproduce Steps

Run the Pivot Table tests in NPOI.OOXML.TestCases.Multitarget (net481)

Issue Description

All PivotTable tests fail coz the method "public ITableStyle GetExplicitTableStyle(String name)" throws an exception which the Tests don't account for

Either the tests can be updated or the method can handle for "key not found" case and return null if not found I went with the quicker solution, which doesnt require signature changes or updates

        if(tableStyles.TryGetValue(name, out ITableStyle style)) return style;
        return null;

should suffice

tonyqus commented 1 month ago

image

I don't see they are failing

divay-ironsoftware commented 4 weeks ago

Screenshot 2024-10-24 100508 This is what I get, but it's flip-flopping, from all red to some green, without any changes except the 1-line

I'll investigate if it's something from my end and update if i find anything machine or setup-specific