ASP Report to Word / PDF etc ??

T

TomT

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
 
T

Tom Kaminski [MVP]

TomT said:
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
 
J

Jeff Cochran

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
 
D

Dan Nash

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
 
D

Dan Nash

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
 
T

Tom Kaminski [MVP]

Dan Nash said:
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
 
J

Jeff Cochran

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
 

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

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top