ASP Report to Word / PDF etc ??

Discussion in 'ASP General' started by TomT, Aug 11, 2004.

  1. TomT

    TomT Guest

    I have created an ASP App that seems to be working well.

    I can get the data out of the Access DB and displayed in screen fine.

    But instead of sending it to the screen, is there any way I can create the
    report and have it saved / outputted as a PDF or word Doc ?

    Any links with examples ??

    Thanks
    TomT, Aug 11, 2004
    #1
    1. Advertising

  2. "TomT" <> wrote in message
    news:14aj9hthbmwf7$.1bwv63lo8njei$...
    > I have created an ASP App that seems to be working well.
    >
    > I can get the data out of the Access DB and displayed in screen fine.
    >
    > But instead of sending it to the screen, is there any way I can create the
    > report and have it saved / outputted as a PDF or word Doc ?
    >
    > Any links with examples ??


    http://support.microsoft.com/default.aspx?scid=kb;EN-US;270906

    --
    Tom Kaminski IIS MVP
    http://www.microsoft.com/windowsserver2003/community/centers/iis/
    http://mvp.support.microsoft.com/
    http://www.iisfaq.com/
    http://www.iistoolshed.com/ - tools, scripts, and utilities for running IIS
    http://www.tryiis.com
    Tom Kaminski [MVP], Aug 11, 2004
    #2
    1. Advertising

  3. TomT

    Jeff Cochran Guest

    On Wed, 11 Aug 2004 17:37:48 +0100, TomT <> wrote:

    >I have created an ASP App that seems to be working well.
    >
    >I can get the data out of the Access DB and displayed in screen fine.
    >
    >But instead of sending it to the screen, is there any way I can create the
    >report and have it saved / outputted as a PDF or word Doc ?


    Sure.

    >Any links with examples ??


    Simplest ASP method I've found is the ASPPDF Persits component:

    http://www.asppdf.com/

    Also see:

    How To Use ASP to Generate a Rich Text Format (RTF) Document to Stream
    to Microsoft Word:
    http://support.microsoft.com/default.aspx?scid=kb;EN-US;270906

    Jeff
    Jeff Cochran, Aug 11, 2004
    #3
  4. TomT

    Dan Nash Guest

    Tom,

    Opening Word and pasting is quite easy, assuming your running on your local
    server. Just use Create Object...

    set app = createobject("Word.Application")
    app.Application.Visible = True
    app.Documents.Add()

    then paste your data in...

    app.Selection.TypeText("yourtext")

    However, if (as is more likely) you want to open Word on the client from ASP
    on the server, it's still possible.

    Basically what you need to do is use some scripting (Javascript / VBScript).
    Unfortunately I haven't got my code handy, but have a look in the help etc,
    sure you'll find something. If you get really stuck, let me know and I'll
    try find the stuff I did.

    HTH


    Dan


    "TomT" <> wrote in message
    news:14aj9hthbmwf7$.1bwv63lo8njei$...
    > I have created an ASP App that seems to be working well.
    >
    > I can get the data out of the Access DB and displayed in screen fine.
    >
    > But instead of sending it to the screen, is there any way I can create the
    > report and have it saved / outputted as a PDF or word Doc ?
    >
    > Any links with examples ??
    >
    > Thanks
    Dan Nash, Aug 11, 2004
    #4
  5. TomT

    Dan Nash Guest

    Hi

    Just noticed the others posts (switched to OE, its acting daft). Just
    thought I'd post the code that I just tried for opening Word on the client
    from server-side ASP...

    <HTML>
    <HEAD>
    <SCRIPT language="VBScript">

    sub doword()
    set app = createobject("Word.Application")
    app.Application.Visible = True
    app.Documents.Add()
    end sub

    </SCRIPT>
    </HEAD>

    <BODY onload="doword()">
    </BODY>
    </HTML>

    In order for this to work, your server needs to be in your "Trusted Sites"
    list in IE. However, from here you can write code to make word automatically
    print things and close, without the need to create a Word/RTF file first.

    Cheers


    Dan


    "TomT" <> wrote in message
    news:14aj9hthbmwf7$.1bwv63lo8njei$...
    > I have created an ASP App that seems to be working well.
    >
    > I can get the data out of the Access DB and displayed in screen fine.
    >
    > But instead of sending it to the screen, is there any way I can create the
    > report and have it saved / outputted as a PDF or word Doc ?
    >
    > Any links with examples ??
    >
    > Thanks
    Dan Nash, Aug 11, 2004
    #5
  6. "Dan Nash" <> wrote in message
    news:OeIBUG$...
    > Just noticed the others posts (switched to OE, its acting daft). Just
    > thought I'd post the code that I just tried for opening Word on the client
    > from server-side ASP...
    >
    > <HTML>
    > <HEAD>
    > <SCRIPT language="VBScript">
    >
    > sub doword()
    > set app = createobject("Word.Application")
    > app.Application.Visible = True
    > app.Documents.Add()
    > end sub
    >
    > </SCRIPT>
    > </HEAD>
    >
    > <BODY onload="doword()">
    > </BODY>
    > </HTML>


    For my own education, what server-side ASP code is in this sample?

    --
    Tom Kaminski IIS MVP
    http://www.microsoft.com/windowsserver2003/community/centers/iis/
    http://mvp.support.microsoft.com/
    http://www.iisfaq.com/
    http://www.iistoolshed.com/ - tools, scripts, and utilities for running IIS
    http://www.tryiis.com
    Tom Kaminski [MVP], Aug 12, 2004
    #6
  7. http://www.activeup.com/products/components/activertf/


    TomT wrote:
    > I have created an ASP App that seems to be working well.
    >
    > I can get the data out of the Access DB and displayed in screen fine.
    >
    > But instead of sending it to the screen, is there any way I can
    > create the report and have it saved / outputted as a PDF or word Doc ?
    >
    > Any links with examples ??
    >
    > Thanks
    Michel Thiffault, Aug 12, 2004
    #7
  8. TomT

    Jeff Cochran Guest

    On Thu, 12 Aug 2004 08:15:05 -0700, "Dan Nash" <>
    wrote:

    >None. THATs the code. If you mean whys that code of use in an ASP forum, I
    >was just it might be useful for TomT.


    Your statement was:

    "Just thought I'd post the code that I just tried for opening Word on
    the client from server-side ASP..."

    And then you posted client side code, no ASP.

    >However, I usually find it's pretty useless like that, unless you know what
    >you want to put in word in the first place. Usually, I end up using ASP to
    >write the VBS function (using Response.Write("<script language...") etc) to
    >do what I want it to do (create/print a letter, etc).


    That's using ASP to send a static page, which is kind of silly. You
    make the server work to process something it never needed to touch,
    since this is all on the client.

    >At the mo I'm using it to create a mail merge based on information coming
    >from Access. Seems to work fine.


    Your sample has nothing to do with retrieving data and merging it on
    the client. Which naturally relies on the client being configured
    appropriately. In an intranet you may have that luxury, but what if
    the poor user is trying to use a system that doesn't have Word? Such
    as his cell phone?

    Jeff



    >"Tom Kaminski [MVP]" wrote:
    >
    >> "Dan Nash" <> wrote in message
    >> news:OeIBUG$...
    >> > Just noticed the others posts (switched to OE, its acting daft). Just
    >> > thought I'd post the code that I just tried for opening Word on the client
    >> > from server-side ASP...
    >> >
    >> > <HTML>
    >> > <HEAD>
    >> > <SCRIPT language="VBScript">
    >> >
    >> > sub doword()
    >> > set app = createobject("Word.Application")
    >> > app.Application.Visible = True
    >> > app.Documents.Add()
    >> > end sub
    >> >
    >> > </SCRIPT>
    >> > </HEAD>
    >> >
    >> > <BODY onload="doword()">
    >> > </BODY>
    >> > </HTML>

    >>
    >> For my own education, what server-side ASP code is in this sample?
    >>
    >> --
    >> Tom Kaminski IIS MVP
    >> http://www.microsoft.com/windowsserver2003/community/centers/iis/
    >> http://mvp.support.microsoft.com/
    >> http://www.iisfaq.com/
    >> http://www.iistoolshed.com/ - tools, scripts, and utilities for running IIS
    >> http://www.tryiis.com
    >>
    >>
    >>
    Jeff Cochran, Aug 13, 2004
    #8
    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. James Wallace
    Replies:
    0
    Views:
    1,040
    James Wallace
    Oct 17, 2003
  2. Sharon
    Replies:
    0
    Views:
    592
    Sharon
    Jul 27, 2005
  3. Kevin Walzer

    Re: PIL (etc etc etc) on OS X

    Kevin Walzer, Aug 1, 2008, in forum: Python
    Replies:
    4
    Views:
    374
    Fredrik Lundh
    Aug 13, 2008
  4. KYG
    Replies:
    2
    Views:
    875
    Ian Collins
    Aug 18, 2008
  5. Jen
    Replies:
    0
    Views:
    94
Loading...

Share This Page