I dont know if i missed this in your ASP lessons or not. When i display information from my web database using an SQL string (say a list of customers), i would like to save it as a PDF or CSV file. How can i achieve that? Please let me know. Thanx.
MICAH
Reply from Richard Rost:
Saving as a PDF requires specialized software to format the file correctly. You can create a CSV text file using file I/O commands on the server. I haven't covered that in any of my ASP lessons so far, but it's on the list for the future. It only takes a few lines of code. Something like:
set FS = Server.CreateObject("Scripting.FileSystemObject") set F = FS.CreateTextFile("c:\website\temp\myfile.txt",true) F.write("Hi there!") F.close set F = nothing set FS = nothing
This folder has to be available to your web site AND the web server (IIS) has to have read/write access to it... so make sure there's nothing else sensitive in there because folks will be able to view ALL of the files in that folder. I usually set up a /temp folder in my web site for stuff like this.
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Active Server Pages Forum.