.NET有效的方式来生成WORD文档 - 服务器端 [英] .NET Efficient way to generate WORD Doc - Server Side

查看:482
本文介绍了.NET有效的方式来生成WORD文档 - 服务器端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

.NET 4.0

我要寻找生成我们的服务器上的Word文档的最简单方法。

I am looking for the easiest way to generate a Word document on our server.

限制:

  • 在服务器端
  • 我不想在服务器上安装字
  • 在数据源是XML

我试图生成DOCX用XSLT是快速和容易的,但我能找到的唯一方法来验证生成的文件是用Word和我得到的时候该文件是无效的唯一错误打开它,而错误打开文件。不是非常有用。

I tried to generate a DOCX with XSLT which is fast and easy but the only way I could find to validate the generated document is to open it with Word and the only error I get when the document is not valid is "Error while opening document". Not very useful.

任何想法?

谢谢, 亚历克斯

推荐答案

您有两个选项给你安装。

You have two options given your setup.

  1. 使用第三方库,类似的东西可以从 SyncFusion
  2. 使用XML路线,初始设置是不好玩的,但一旦你得到它的过程很简单。

第三,更粗暴的方式是编写一个HTML文件,并保存为名为.doc,但这会导致用户侧的警告与2007年和更高版本。

A third, much more crude way would be to write an HTML file and save as .doc, but that is going to cause warnings on the user side with 2007 and later.

这篇关于.NET有效的方式来生成WORD文档 - 服务器端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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