NPOI 1.2.3 - 重复的 PageSettingsBlock 记录(sid=0x12)
我一直在测试 NPOI 1.2.3 以填充各种 Excel 模板。它工作正常,但在我对其中一个 Excel 模板进行更改后,我收到此错误:
重复 PageSettingsBlock 记录 (sid=0x12)
该错误发生在下面的第 2 行:
Dim fs As New FileStream(Server.MapPath("xls\myTemplate.xls"), FileMode.Open, FileAccess.Read)
Dim workbook As New HSSFWorkbook(fs, True)
I在这里看到了一个讨论,其中提到 NPOI 1.2.4 是一个修复程序 http://npoi.codeplex.com/discussions/252132, 但 1.2.4 目前处于 Alpha 阶段。
也许我最终会只使用 1.2.4, 但有谁知道这个错误的可能原因?我能拥有什么 在 XLS 文件中进行编辑会导致错误发生?
更新:在 http://下载 Alpha 1.2.4 版本后/code.google.com/p/npoi/downloads/list, 问题停止了。不过,如果能知道 1.2.3 中错误的原因就好了。
I've been testing NPOI 1.2.3 for populating various Excel templates. It was working fine, but after I made a change to one of the excel templates, I'm getting this error:
Duplicate PageSettingsBlock record (sid=0x12)
The error happens right at line 2 below:
Dim fs As New FileStream(Server.MapPath("xls\myTemplate.xls"), FileMode.Open, FileAccess.Read)
Dim workbook As New HSSFWorkbook(fs, True)
I've seen a discussion here that mentions NPOI 1.2.4 as being a fix
http://npoi.codeplex.com/discussions/252132,
but 1.2.4 is currently in Alpha.
Maybe I'll end up just using 1.2.4,
but does anyone know the possible causes of this error? What could I have
edited in the XLS file that would cause the error to occur?
Update: After downloading the Alpha 1.2.4 release at http://code.google.com/p/npoi/downloads/list,
the problem stopped. Still, it would be nice to know the cause of the error in 1.2.3.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是 NPOI 1.2.3 中引入的错误,它没有正确从 POI 3.6/3.7 迁移新的 pagesettingsblock。它已在 NPOI 1.2.4 中修复
This is a bug introduced in NPOI 1.2.3, which didn't migrate the new pagesettingsblock from POI 3.6/3.7 correctly. It was fixed in NPOI 1.2.4