Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   creating word document in asp.net (http://www.velocityreviews.com/forums/t77988-creating-word-document-in-asp-net.html)

Nikhil Patel 05-12-2004 07:08 PM

creating word document in asp.net
 
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



Ken Cox [Microsoft MVP] 05-12-2004 07:16 PM

Re: creating word document in asp.net
 
The safest way is to use a .NET component rather than Word itself..

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

"Nikhil Patel" <nikhil0100@aol.com> wrote in message
news:uVTnXHFOEHA.644@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
>
>



Alex Papadimoulis 05-12-2004 09:15 PM

Re: creating word document in asp.net
 
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" <nikhil0100@aol.com> wrote in message
news:uVTnXHFOEHA.644@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
>
>




Steve C. Orr [MVP, MCSD] 05-12-2004 10:23 PM

Re: creating word document in asp.net
 
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]" <BANSPAMken_cox@sympatico.ca> wrote in message
news:e2UphWFOEHA.3028@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" <nikhil0100@aol.com> wrote in message
> news:uVTnXHFOEHA.644@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
> >
> >

>




Nikhil Patel 05-13-2004 02:56 PM

Re: creating word document in asp.net
 
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" <alexp@papadimoulis.com> wrote in message
news:uzG2%23YGOEHA.904@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" <nikhil0100@aol.com> wrote in message
> news:uVTnXHFOEHA.644@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
> >
> >

>
>





All times are GMT. The time now is 01:16 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.