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

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

问题描述

我需要创建一个Excel通过C#文件。我已阅读了几个地方,创建一个XML文档是做最简单的方法?我需要有多个命名选项卡和可以指定特定的细胞是文本,日期时间,数字等...任何建议或好的例子?

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?

推荐答案

您需要系统。 IO.Packaging API - 这将让你在的值插入Excel 2007中单元格。将Excel 2007格式还可以使用用Excel 2003和XP与游离的 Microsoft Office兼容包的安装。

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.

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

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