从ASP.NET生成Word文档的最佳解决方案是什么?

问题描述:

我想从我的ASP.NET应用程序生成一个Word文档.当前,我们显示一个议程列表",它是议程信息和所有项目/主题.此页面需要具有用文字打开的功能.议程页面不是静态的,它是从SQL Server中提取的议程项目的动态列表.

I would like to generate a word document from my ASP.NET application. Currently we show an "Agenda List" which is the agenda information and all items/subjects. This page needs to have the ability to open in word. The agenda page is not static, it's a dynamic list of agenda items pulled from SQL Server.

对最佳解决方案有何建议?我正在寻找一种快速的解决方案,而OpenXML似乎有点耗时.我愿意购买第三方工具.

Any suggestions on the best solution? I'm looking for a quick solution and OpenXML seems to be a bit too time consuming. I'm open to purchasing third party tools.

谢谢!

使用Office OpenXML SDK.对于更高版本的Office(2007及更高版本),这是标准.还有其他答案中提到的其他方法,但是OpenXML将为您提供对输出的最大控制.

Use the Office OpenXML SDK. For later versions of Office (2007 and above), this is the standard. There are other ways as mentioned in other answers, but OpenXML will give you the greatest level of control over the output.

以下是一些文档,可以帮助您入门: http://msdn.microsoft.com/en-us/office/bb265236.aspx

Here is some documentation to get you started: http://msdn.microsoft.com/en-us/office/bb265236.aspx