In Asp.net, you do not need to install word on the server. You can use XML to generate WORD Documents.

Source: Internet
Author: User

Today, I saw the carloads provided by the website recommended by the inspiration source. excelxmlwriter, I think it is good. I have a look at the decompilation. In fact, I am constructing an XML document and then using writer1.writeprocessinginstruction ("MSO-application", "progid = 'excel. sheet '"); To set to open in Excel, so we can easily obtain an Excel. Obviously, this method does not require the server to install Excel.

I suddenly thought that I could generate a word in the same way. The answer is yes. This blog pointed out the method:
Http://weblogs.asp.net/cnagel/archive/2004/09/25/234188.aspx
Make a simple example. Copy the following xmlto notepad, save it as test.doc, and open it.
<? XML version = "1.0" encoding = "UTF-8"?>
<? MSO-application progid = "word. Document"?>
<W: worddocument xmlns: W = "http://schemas.microsoft.com/office/word/2003/wordml">
<W: Body>
<W: P>
<W: r>
<W: T> the MS-2524, XML Web Services programming </W: T>
</W: r>
</W: P>
<W: P>
<W: r>
<W: T> MS-2124, C # programming </W: T>
</W: r>
</W: P>
<W: P>
<W: r>
<W: T> net2,. NET 2.0 early adapter </W: T>
</W: r>
</W: P>
</W: Body>
</W: worddocument>

So why can't we use the same principle of carlow.excelxmlwriter to provide a class library that generates word without installing word?
However, it should be noted that I have not tested whether earlier versions of word support me. I am using Office 2003. Office 2003 XML reference schemas can be downloaded:
Http://www.microsoft.com/downloads/details.aspx? Familyid = fe118952-3547-420a-a412-00a2662442d9 & displaylang = en

In addition, the source of inspiration once provided a smartexcel class library, you can also generate an excel without installing excel, but the principle is similar to carloader. different from excelxmlwriter, excelxmlwriter should directly write files in Excel format.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.