I have a win 2003 server and am running ASP. The customer fills out an online application form and submits it. The data goes into the fields of an MS SQL 2000 DB.
Is there a way to get the data to appear in either a .pdf or .doc file automatically and according to a template?
In other words I want the order to be created in a .pdf file on the server and email to me. Is that possible?
It is possible to get the data from an ASP page to Word document by changing content type of the server response.
Here is the small example to show that it is possible.
“Test.asp” file goes like this:
----------------------------------------------------------------
<%
Response.ContentType = "application/vnd.ms-word"
Response.Buffer = True
Response.ContentType = "application/vnd.ms-word"
Response.AddHeader "content-disposition", "inline; filename = My_Word_Doc.doc"
%>
Here is your text. Blah-blah-blah…
----------------------------------------------------------------
Create the file in your C:\Inetpub\wwwroot directory;
Point your browser to localhost/Test.asp and you will be prompt to open or save Word document file. Also Word document could be opened automatically inside a browser (depend on a browser settings)
With PDF the story little bit different. The thing is PDF should be converted from some other file. It could be simple txt file or Word document.
So regarding creating PDF on fly
Step 1:
Create on fly txt file (using FSO) or Word document (with the method above).
Step 2:
Convert created file to PDF.
To convert you could use third party applications try "pdf converter" in Google.
G00gleB0t
07-17-2006, 04:21 AM
You can use OLE Automation to create Word files.