creating word document in asp.net

Discussion in 'ASP .Net' started by Nikhil Patel, May 12, 2004.

  1. Nikhil Patel

    Nikhil Patel Guest

    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, May 12, 2004
    #1
    1. Advertising

  2. The safest way is to use a .NET component rather than Word itself..

    http://www.aspose.com/Products/Aspose.Word/Intro/Overview.html

    "Nikhil Patel" <> wrote in message
    news:...
    > 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], May 12, 2004
    #2
    1. Advertising

  3. 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" <> wrote in message
    news:...
    > 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, May 12, 2004
    #3
  4. In addition to Ken's high quality suggestion, you might also consider this
    similar 3rd party product:
    http://officewriter.softartisans.com/officewriter-8.aspx

    --
    I hope this helps,
    Steve C. Orr, MCSD, MVP
    http://Steve.Orr.net


    "Ken Cox [Microsoft MVP]" <> wrote in message
    news:...
    > The safest way is to use a .NET component rather than Word itself..
    >
    > http://www.aspose.com/Products/Aspose.Word/Intro/Overview.html
    >
    > "Nikhil Patel" <> wrote in message
    > news:...
    > > 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], May 12, 2004
    #4
  5. Nikhil Patel

    Nikhil Patel Guest

    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" <> wrote in message
    news:uzG2%...
    > 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" <> wrote in message
    > news:...
    > > 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, May 13, 2004
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Tm92aWNl?=

    Creating Word Document in ASP.NET Application

    =?Utf-8?B?Tm92aWNl?=, Aug 17, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    12,702
    =?Utf-8?B?Tm92aWNl?=
    Aug 17, 2004
  2. Steve C. Orr [MVP, MCSD]

    Re: Creating Word document File in C# .Net

    Steve C. Orr [MVP, MCSD], Aug 29, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    2,768
    Steve C. Orr [MVP, MCSD]
    Aug 29, 2004
  3. Bruno MAIGNAN
    Replies:
    1
    Views:
    406
    Cubaman
    Jun 22, 2010
  4. Bruno MAIGNAN
    Replies:
    2
    Views:
    924
  5. Bruno MAIGNAN
    Replies:
    0
    Views:
    335
    Bruno MAIGNAN
    Jun 21, 2010
Loading...

Share This Page