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

xlsx file can be broken if it is generated by NPOI 2.4.1 #1454

Open
lifuhua123 opened this issue Dec 5, 2024 · 5 comments
Open

xlsx file can be broken if it is generated by NPOI 2.4.1 #1454

lifuhua123 opened this issue Dec 5, 2024 · 5 comments
Labels
file_error file format generation/writing issue question

Comments

@lifuhua123
Copy link

NPOI Version

2.4.1 2.5.6

File Type

XLSX

Upload the Excel File

ACFC_23340000001_2024年12月05日09时22分06秒_回波诊断.xlsx

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

Reproduce Steps

Issue Description

导出的xlsx格式文件使用office打开提示有兼容性问题
企业微信截图_17332929217187

@lifuhua123 lifuhua123 added the bug label Dec 5, 2024
@tonyqus
Copy link
Member

tonyqus commented Dec 5, 2024

请上传原始的模板文件

@tonyqus tonyqus added file_error file format generation/writing issue need-investigation and removed bug labels Dec 5, 2024
@tonyqus tonyqus changed the title 导出的xlsx格式文件使用office打开提示有兼容性问题 xlsx file can be broken if it is generated by NPOI 2.4.1 Dec 5, 2024
@tonyqus
Copy link
Member

tonyqus commented Dec 7, 2024

The following sheetView section is not correctly generated in sheetX.xml

<sheetViews>
<sheetView tabSelected="1" showRuler="1" showOutlineSymbols="1" defaultGridColor="1"
 colorId="64" zoomScale="100" workbookViewId="0">
	<pane xSplit="6" ySplit="2" topLeftCell="A1" activePane="bottomRight" state="frozen"/>
	<selection pane="bottomRight"/>
</sheetView>
</sheetViews>

@tonyqus
Copy link
Member

tonyqus commented Dec 7, 2024

Related commits: 9e6bdeb

@tonyqus
Copy link
Member

tonyqus commented Dec 7, 2024

#578

@antony-liu
Copy link
Collaborator

antony-liu commented Jan 22, 2025

该问题是属性topLeftCell的值错误引起。该值受到属性xSplit和ySplit的值的约束,其所表示的单元格的列数和行数要大于xSplit和ySplit。

<pane xSplit="6" ySplit="2" topLeftCell="A1" activePane="bottomRight" state="frozen"/>

上述代码中topLeftCell="A1",指第一行第一列,该单元格处于冻结区域内,Excel打开就会报错,如果改为G3,单元格位于非冻结区域,就不会报错。

@lifuhua123 不清楚你是如何创建冻结窗格的,我猜是用XSSFSheet.CreateFreezePane(colSplit, rowSplit, leftmostColumn, topRow)创建的,但参数leftmostColumntopRow给错了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
file_error file format generation/writing issue question
Projects
None yet
Development

No branches or pull requests

3 participants