Output Excel Header Row Names (Full Version)

All Forums >> [Web Development] >> ASP, PHP, and Database



Message


chadb -> Output Excel Header Row Names (6/24/2009 10:11:18)

Is there way to to custom name the header row in Excel? Also format a column?
Here is how I am doing it:
sql = request.form("sqlcmd")

set Conn=server.createobject("adodb.connection")
Conn.open DSN
Set RS = Conn.Execute (SQL)

Dim F, Head
For Each F In RS.Fields
Head = Head & ", " & F.Name
Next
Head = Mid(Head,3) & vbCrLf
Response.Addheader "Content-Disposition", "inline; filename=OperationHrs.csv"
Response.ContentType = "application/download"
Response.Write Head
Response.Write Replace(Replace(RS.GetString(,,"QQQQ",vbCrLf,""),",","-"),"QQQQ",",")
'Response.Write RS.GetString(,,", ",vbCrLf,"")
Set RS = nothing
Conn.close

Thanks
Chad




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.109375