在没有安装office的情况下在.net中创建excel文件
我需要在未安装 Microsoft Office 的生产服务器 (Windows Server 2008) 上使用 .net 创建 Excel 文件(包含多个工作表)。 借助VS2010和Windows Server 2008可以实现这一点吗? 或者有什么方法可以通过使用 Office Web 应用程序来实现这一目标。
I require to create excel files (with multiple sheets) using .net on a production server (Windows Server 2008) where Microsoft Office is not installed.
Can this be fulfilled with the help of VS2010 and Windows Server 2008.
or is there any way to achieve this by using office webapps.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我使用 OpenXML SDK 就是为了这个目的。它不允许您在服务器环境中实际计算和运行函数,但它非常适合创建和操作工作簿。
下载:
http:// /www.microsoft.com/downloads/en/details.aspx?FamilyId=C6E744E5-36E9-45F5-8D8C-331DF206E0D0&displaylang=en
文档:
http://msdn.microsoft.com/en-us/library/bb448854.aspx
I use the OpenXML SDK which is intended for that purpose. It doesn't allow you to actually calculate and run functions in a server environment but its very good for creating and manipulating workbooks.
Download:
http://www.microsoft.com/downloads/en/details.aspx?FamilyId=C6E744E5-36E9-45F5-8D8C-331DF206E0D0&displaylang=en
Documentation:
http://msdn.microsoft.com/en-us/library/bb448854.aspx
您可以使用此库:http://epplus.codeplex.com/releases/view/42439
它跳过 Excel 二进制文件的使用,转而使用 Excel XML 格式,因此编写 Excel 可以正确理解和呈现的纯文本、简单文本。
You can use this library: http://epplus.codeplex.com/releases/view/42439
It skips use of Excel binaries, in favor of the Excel XML format, therefore writing plain, simple text which Excel can understand and render properly.
如果目标是 Office 2007 或 2010,您可以尝试使用这个免费库 http://epplus.codeplex.com/
如果目标是 <= 2003,您可以尝试使用 GemBox.Spreadsheet
免费版本仅限于:
每张纸的最大行数为 150。
每个工作簿的最大工作表数为 5。
If the target is office 2007 or 2010, you can try with this free library http://epplus.codeplex.com/
If the target is <= to 2003 you can try with GemBox.Spreadsheet
The free version is limited to :
Maximum number of rows per sheet is 150.
Maximum number of sheets per workbook is 5.
使用官方的 Microsoft OpenXML SDK。
Use the official Microsoft OpenXML SDK.
试试这个:
Try this: