用于 C# 将数据表输出到 Excel 的最佳免费 Excel 编写器

发布于 2024-07-22 18:13:53 字数 306 浏览 4 评论 0原文

我有一个加载数据表的控制台应用程序; 我想将其导出为 Excel 格式,并将其附加到定期发送的电子邮件中。

为了让我可以免费下载,最好的图书馆是什么? 我在一家学术机构工作,我们没有第三方控制的预算。


可能的相关问题: 如何将数据从 DataSet 存储到 Excel 而不逐个单元格存储?

I've got a console app that loads up a datatable; I'd like to export that to an Excel format and attach it to an email that's sent out on a regular basis.

What is the best library to do so that I can pull down for free? I'm working for an academic institution and we don't have a budget for third-party controls.


possible related question: How to store data to Excel from DataSet without going cell-by-cell?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

无边思念无边月 2024-07-29 18:13:53

另一个免费库是CarlosAg Excel Xml Writer Library。 支持新的基于 xml 的格式。

澄清:当我们在这里讨论 MS Excel 时,新的基于 xml 的格式是 MS Office XML

Another free lib is CarlosAg Excel Xml Writer Library. Supports the new xml-based format.

Clarification: as we are talking about MS Excel here the new xml-based format is MS Office XML.

匿名的好友 2024-07-29 18:13:53

我只是将 CSV 文件写入硬盘。

I would just write a CSV file to the hard drive.

吾家有女初长成 2024-07-29 18:13:53

当我由于某种原因无法使用商业工具时,我通常使用 MyXls

无耻的自我推销:你可以看看我的 SpreadsheetFactory 工具,这是一个设计的工具使将 IEnumerable 集合导出到电子表格更加容易。 它使用 MyXls 作为底层 xls 引擎。

I usually use MyXls when I can't use commercial tools for some reason.

Shameless self-promotion: You could have a look at my SpreadsheetFactory tool, which is a tool designed to make exporting IEnumerable collections to spreadsheets easier. It is using MyXls as underlying xls engine.

撩发小公举 2024-07-29 18:13:53

您可以仅使用 ODBCConnection 和指定电子表格文件的连接字符串。

编辑:这不需要服务器计算机上有 Excel。 它将生成一个可在客户端计算机上使用 MS Excel 读取的 .xls 文件。

请参阅如何将数据存储到数据集中的 Excel 无需逐个单元格?了解更多详细信息。

You can just use a ODBCConnection with the connection string specifying the spreadsheet file.

EDIT: This does not require Excel on the server machine. It will produce an .xls file that can be readable on the client machine with MS Excel.

see How to store data to Excel from DataSet without going cell-by-cell? for more detail.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文