简体   繁体   English

如何使用DOT文件导出数据?

[英]How can I use DOT files to export data's?

I need to export data into a word doc using ".dot" models, with an application written in asp.net. 我需要使用“ .dot”模型将数据导出到word doc中,并使用asp.net编写应用程序。 Can you give me some links to learn this trick? 您可以给我一些链接来学习此技巧吗? I'm sure is it possible without any external libraries. 我敢肯定,没有任何外部库也是有可能的。 Thanks to the universal knowledge ;-) 多亏了普世知识;-)

I doubt you will able to do this without any extra libraries. 我怀疑您是否可以在没有任何额外库的情况下执行此操作。

If you are using Word 2007+ format (eg .docx, .dotx) you can use the Open XML SDK . 如果您使用的是Word 2007+格式(例如.docx,.dotx),则可以使用Open XML SDK If not, your best bet is probably Aspose.Words 如果没有,那么最好的选择可能是Aspose.Words

You'll need to have MS Word installed on the machine that will fill the templates (.dot files), and then you can call an instance of Word to do the replacements for you, using Microsoft.Office.Interop.Word. 您需要在将填充模板(.dot文件)的计算机上安装MS Word,然后可以使用Microsoft.Office.Interop.Word调用Word的实例为您进行替换。

If this has to be implemented on a server, you might have a problem. 如果必须在服务器上实施此操作,则可能有问题。 Microsoft advises against installing Office on servers because of stability and reliability issues. 由于稳定性和可靠性问题,Microsoft建议不要在服务器上安装Office。 http://support.microsoft.com/kb/257757 focusses on some of these problems and also mentions some alternatives. http://support.microsoft.com/kb/257757着重介绍了其中一些问题,并提到了一些替代方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM