如何Word文档在C#中创造的呢? [英] How can a Word document be created in C#?

查看:129
本文介绍了如何Word文档在C#中创造的呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个项目,我想生成一个报表导出MS Word格式。该报告将包括图像/图,表和文字。什么是做到这一点的最好方法是什么?第三方工具?你有什么经验?

I have a project where I would like to generate a report export in MS Word format. The report will include images/graphs, tables, and text. What is the best way to do this? Third party tools? What are your experiences?

推荐答案

答案是会,如果应用程序在服务器上,或者如果在客户端计算机上运行的运行时略有依赖。如果您在一台服务器上运行,那么你将要使用的基于XML的办公代格式之一,因为有知道的问题时,使用办公自动化的服务器

The answer is going to depend slightly upon if the application is running on a server or if it is running on the client machine. If you are running on a server then you are going to want to use one of the XML based office generation formats as there are know issues when using Office Automation on a server.

不过,如果你正在使用的客户机上,那么你要么使用办公自动化<的选择/ A>或使用的Office Open XML格式(见下面的链接),这是支持Microsoft Office 2000和起来无论是本地或通过服务包。一划回这虽然是你可能无法嵌入某些类型的,你希望显示图形或图像。

However, if you are working on the client machine then you have a choice of either using Office Automation or using the Office Open XML format (see links below), which is supported by Microsoft Office 2000 and up either natively or through service packs. One draw back to this though is that you might not be able to embed some kinds of graphs or images that you wish to show.

去了解事情的最好方法都将在你有多少时间投资发展取决于悦目。如果你去办公自动化的途径也有不少很好的教程在那里,可以通过谷歌发现,是相当简单易学。然而,打开Office XML格式是相当新的,所以你可能会发现学习曲线有点高。

The best way to go about things will all depend sightly upon how much time you have to invest in development. If you go the route of Office Automation there are quite a few good tutorials out there that can be found via Google and is fairly simple to learn. However, the Open Office XML format is fairly new so you might find the learning curve to be a bit higher.

的Office Open XML Iinformation

Office Open XML Iinformation

  • Office Open XML - http://en.wikipedia.org/wiki/Office%5FOpen%5FXML
  • OpenXML Developer - http://openxmldeveloper.org/default.aspx
  • Introducing the Office (2007) Open XML File Formats - http://msdn.microsoft.com/en-us/library/aa338205.aspx

这篇关于如何Word文档在C#中创造的呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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