保存 Excel 2007 文档
在 .NET C# 中,我尝试打开 Excel 模板,添加一些数据并将其另存为新文档。 我正在尝试使用 OpenXML 文档格式。 我似乎找不到任何关于如何执行此操作的指导。 似乎所有文档都讨论了如何将各个部分写入包中,但我找不到任何有关完成并想要保存它时要做什么的信息。
有人知道我在哪里可以找到这些信息吗? 我一定是错误地思考了这个问题,因为我在看似非常基本的东西上找不到任何有用的东西。
谢谢
In .NET C# I'm trying to open an Excel template, add some data and save it as a new document. I'm trying to use the OpenXML document format. I can't seem to find any guidance on how to do this. Seems like all the documentation talks about how to write various parts to the Package but I can't find anything on what to do when you're done and want to save it.
Anyone know where I can find this information? I must be thinking about this incorrectly because I'm not finding anything useful on what seems to be very basic.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
ExcelPackage 对此效果非常好。 我认为主要作者还没有对它进行过一段时间的开发,但它在其论坛上有很多追随者,可以解决任何问题。
ExcelPackage works pretty good for that. It hasn't been worked on by the primary author I dont think for a little while but it has a good following of people on its forum that work any issues out.
访问 Open XML / SpreadsheetML 文档绝非易事。 规格庞大且复杂。 “Open XML SDK”(谷歌一下)肯定有帮助,但仍然需要一些 Open XML 标准的知识才能完成很多工作。
SpreadsheetGear for .NET 具有类似于 Excel 的 API,可以读取和写入 Excel Open XML (xlsx) 文档,如下所示以及 Excel 97-2003 (xls) 文档。
您可以在此处查看一些 SpreadsheetGear 示例,并下载免费试用版此处。
免责声明:我拥有 SpreadsheetGear LLC
Accessing Open XML / SpreadsheetML documents is far from a trivial exercise. The specification is large and complex. The "Open XML SDK" (google it) definitely helps, but still requires some knowledge of the Open XML standard to get much done.
SpreadsheetGear for .NET has an API similar to Excel and can read and write Excel Open XML (xlsx) documents as well as Excel 97-2003 (xls) documents.
You can see some SpreadsheetGear samples here and download a free trial here.
Disclaimer: I own SpreadsheetGear LLC