creating word document in asp.net

N

Nikhil Patel

Hi all,

I need to generate a word document and save it on the server from an
ASP.Net application. Basically I want to load a word template and insert
some field values from a dataset and save the final output as a Word
document. I know there are different options to do this. But I can't decide
which one I should use. I don't want to use automation on the server because
of scalability issues and it is not recommended by Microsoft. So I am
thinking of using an xslt template. I would load the template and insert the
field values from the dataset using XslTransform class. But the problem is
that we will need to change the template frequently and it will be difficult
to change the template in XSLT. The document will be about 5 pages and there
will be only 30 field values(from a single dataset row) that we need insert
into the template. So I think it is not worth keep changing 5 page XSLT
template to insert 30 field values. Is there any other option or is there an
easy way to insert values into word ( xml or other) template from a dataset?



Thanks.

-Nikhil
 
A

Alex Papadimoulis

Nikhil,

If your users are on Office2003, then you can easily create your template,
create XML fields in the document, save it as a WordXML file, and then load
it up with an XML reader and replace the field values. If your stuck with
earlier version, then you'll need to use automation or a component that uses
automation to do this. But then it can get pretty ugly.

-- Alex Papadimoulis
 
N

Nikhil Patel

Thank you all for your replies. I am using Office2003. If I create XML
fields in the the document, will I still need to write an XSLT template to
fill their values.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top