用C#构建Excel文件 [英] Building Excel Files with C#

查看:98
本文介绍了用C#构建Excel文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要通过C#创建一个excel文件。我已经阅读了几个创建XML文档的地方是最简单的方法吗?我需要有多个命名选项卡,并能够指定特定的单元格是文本,日期时间,数字等...任何建议或好的例子?

解决方案

您需要系统。 IO.Packaging API - 这将允许您按照将值插入Excel 2007单元格。 Excel 2007和Excel的Excel 2007格式也可以使用免费的 Microsoft Office Compatibility Pack


I need to create an excel file via C#. I have read a few places that creating an XML document is the easiest way to do this? I need to have multiple named tabs and be able to specify that particular cells are text, date time, numeric, etc... Any suggestions or good examples?

解决方案

You need the System.IO.Packaging API - this will allow you to generate .xlsx documents as described in Inserting Values into Excel 2007 Cells. The Excel 2007 format can also be used by Excel 2003 and XP with the free Microsoft Office Compatibility Pack installed.

这篇关于用C#构建Excel文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆