I am using ASP to Import data from SQL server and then export it to excel.
I though want a header text in row 1 ie cells a1 to n1 But how do I write command that can merge those fields ? then I would be able to insert my header txt.
I have this asp code:
'setup the excel file
Dim objFSO, objExcelFile
Set objFSO = CreateObject("Scripting.FileSystemObject")
excelfilename = "Financials_clients_" & nn & ".xls"
Set objExcelFile = objFSO.CreateTextFile(Server.MapPath(excelfilename))
'Do the header information
objExcelFile.writeline ("<html>")
objExcelFile.writeline ("<table border=1>")
'This header is just shown in one cell ie A1 ... I want it from a1 - n1
objExcelFile.writeline (" <td bgcolor=#cccccc> CLIENT开发者_JS百科 LEVEL - " & product_header & "</td>")
any other suggestions are highly appreciated.
Your code is outputting everything in one cell, you would need to change it to output in multiple table cells.
objExcelFile.writeline (" <td bgcolor=#cccccc> CLIENT LEVEL - " & header1 & "</td><td>" & header2 & "</td><td>" & header3 & </td>........")
精彩评论