By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,469 Members | 1,259 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,469 IT Pros & Developers. It's quick & easy.

creating word document in asp.net

P: n/a
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
Nov 18 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
The safest way is to use a .NET component rather than Word itself..

http://www.aspose.com/Products/Aspos.../Overview.html

"Nikhil Patel" <ni********@aol.com> wrote in message
news:uV*************@tk2msftngp13.phx.gbl...
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


Nov 18 '05 #2

P: n/a
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

"Nikhil Patel" <ni********@aol.com> wrote in message
news:uV*************@tk2msftngp13.phx.gbl...
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

Nov 18 '05 #3

P: n/a
In addition to Ken's high quality suggestion, you might also consider this
similar 3rd party product:
http://officewriter.softartisans.com...ewriter-8.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"Ken Cox [Microsoft MVP]" <BA************@sympatico.ca> wrote in message
news:e2**************@TK2MSFTNGP11.phx.gbl...
The safest way is to use a .NET component rather than Word itself..

http://www.aspose.com/Products/Aspos.../Overview.html

"Nikhil Patel" <ni********@aol.com> wrote in message
news:uV*************@tk2msftngp13.phx.gbl...
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

Nov 18 '05 #4

P: n/a
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.

"Alex Papadimoulis" <al***@papadimoulis.com> wrote in message
news:uz***************@TK2MSFTNGP12.phx.gbl...
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

"Nikhil Patel" <ni********@aol.com> wrote in message
news:uV*************@tk2msftngp13.phx.gbl...
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


Nov 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.