Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Server --> PDF via ASP 1

Status
Not open for further replies.

snakeeyes1978

Programmer
Jan 11, 2005
70
AU
Currently I have the code listed below, which generates an Excel spreadsheet from the data retrieved from SQL Server using a recordset. Does anyone know if it is possible to extract the data into a PDF file instead?

dim Cn,Rs
set Cn=server.createobject("ADODB.connection")
set Rs=server.createobject("ADODB.recordset")
Cn.open "Provider=SQLOLEDB.1;Persist Security
Info=False;Initial Catalog= (etc etc)"
Rs.open "SELECT * FROM tblRecords",Cn,1,3
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "Content-Disposition", "attachment;
filename=Records.xls"

If RS.EOF = FALSE then
Do while not rs.eof
response.write "<table border=1>"
Response.Write "<tr>"
Response.Write "<td width='140'><b>Name</b></td>"
Response.Write "<td>"
Response.Write rs.fields("Name")
Response.Write "</td></tr>"
RS.Movenext
Loop
End if
 
Hi snakeeyes1978,
Yes, of course it's possible and I'm doing it in ASP & PHP.

There are a couple of free PDF classes for PHP (no need to install anything on your web server) but there are no free components for ASP.

I ended up buying aspPDF ($299) by Persits.
I also tried EasyAspPDF by (~$200) which is good & I'm going to buy it sometimes later but only after its developer will finish AspVisualPDF - a very cool (& also very buggy at this moment) interface for generating code for his PDF component in many languages.
Also, ($70) is the cheapest one to although limited to basic invoices.
is very, very cool - PDF + FLASH output! but costly :(

There are at least 10 more other ASP/ASP.NET components
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top