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

Failed to open excel(.xlsx) with NPOI(2.5.6) with some specific graphs #1059

Closed
fjyuser opened this issue Apr 6, 2023 · 5 comments
Closed
Labels
bug file_error file format generation/writing issue xlsx
Milestone

Comments

@fjyuser
Copy link

fjyuser commented Apr 6, 2023

Currently I'm trying to open the excel (workbook) which contain many sheets and each of the sheet contain multiple graphs.

Unfortunately, I cannot open the file and it throws error, but the error is empty string "" which is weird.

So what I tried is deleting the graph one by one, and then I can open the file.

It seems only 1 graph that cause the error, is there any specific graph that NPOI can handle and cannot handle?

May I know what cause this kind of behavior?

MicrosoftTeams-image (4)
sample のコピー2.xlsx

@tonyqus
Copy link
Member

tonyqus commented Apr 6, 2023

How many graphs and sheets are there in this excel? Can you share the file?

@fjyuser
Copy link
Author

fjyuser commented Apr 7, 2023

Hi, it seems that only specific graph causes the error where I just attached the file. TQ

@tonyqus
Copy link
Member

tonyqus commented Jul 22, 2023

どうもありがとうございます

I can reproduce the issue.
image

@tonyqus
Copy link
Member

tonyqus commented Jul 22, 2023

The issue is caused by the following openxml block in chart1.xml

        <c:marker>
          <c:symbol val="auto"/>
        </c:marker>

The value 'auto' cannot be parsed (recognized) correctly.

@tonyqus
Copy link
Member

tonyqus commented Jul 22, 2023

It's weird that this value is not included in old definition of ST_MarkerStyle
https://c-rex.net/samples/ooxml/e1/Part4/OOXML_P4_DOCX_ST_MarkerStyle_topic_ID0ESVTRB.html

But I found it in Python-openxml lib

<xsd:simpleType name="ST_MarkerStyle">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="circle"/>
<xsd:enumeration value="dash"/>
<xsd:enumeration value="diamond"/>
<xsd:enumeration value="dot"/>
<xsd:enumeration value="none"/>
<xsd:enumeration value="picture"/>
<xsd:enumeration value="plus"/>
<xsd:enumeration value="square"/>
<xsd:enumeration value="star"/>
<xsd:enumeration value="triangle"/>
<xsd:enumeration value="x"/>
<xsd:enumeration value="auto"/>
</xsd:restriction>
</xsd:simpleType>

tonyqus added a commit that referenced this issue Jul 22, 2023
@tonyqus tonyqus added bug xlsx file_error file format generation/writing issue and removed need-investigation labels Jul 22, 2023
@tonyqus tonyqus added this to the NPOI 2.7.0 milestone Jul 22, 2023
@tonyqus tonyqus closed this as completed Jul 22, 2023
@tonyqus tonyqus changed the title Failed to open excel(.xlsx) with NPOI(2.5.6) with too many graph Failed to open excel(.xlsx) with NPOI(2.5.6) with some specific graphs Jul 22, 2023
tonyqus added a commit that referenced this issue Jul 23, 2023
This reverts commit d666b03.
tonyqus added a commit that referenced this issue Jul 23, 2023
@tonyqus tonyqus modified the milestones: NPOI 2.7.0, NPOI 2.6.2 Aug 23, 2023
tonyqus added a commit that referenced this issue Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug file_error file format generation/writing issue xlsx
Projects
None yet
Development

No branches or pull requests

2 participants