2

我正在寻找创建小复杂 Excel 以及 pdf 文档,例如使用 asp.net 和 C# 的发票。

谁能建议我任何我可以使用的库或插件。

4

2 回答 2

1

Assuming you get your data from database, for the Excel you could use DataSet Class and GetXml method of that class, then transform that XML into Excel XML using XSLT. I’ve been using that example: How to transform a DataSet to spreadsheet XML for Excel by using Visual Basic .NET and ASP.NET when I was developing similar functionality. That example is in Visual Basic, however it presents the concept which can be easily transferred to C#. I use that concept for generating downloadable XML also for generating email attachments.

The XSLT also allows applying formatting to the spreadsheet such as data-type, font-style, cell-borders, colors etc. One way to do it is to open new Excel document, format it to the desired look and save it to Excel XML. Then use the generated styles in the XSLT.

于 2014-02-23T11:39:25.813 回答
0

我最近使用了这个CreateExcelFile,一个非常易于使用的库。它使向客户端生成 Excel 文件变得非常容易和方便。

于 2014-02-23T15:52:56.743 回答