export html table in asp.net to excel [modified]
-
hi, i am transferring my table to excel from asp.net the code is as follows. Dim i As Integer Dim s As String s = " " For i = 0 To 100 s = s & " " Next Dim attachment As String attachment = "sameer.xlsx" Response.AddHeader("content-disposition", attachment) Response.ContentType = "application/vnd.ms-excel" Response.Write(" nbsp; ") Response.Write("sameer") Response.Write("roy") Response.Write("
sameer
") Response.End Now the problem is that when im executing the dispaly in browser the table shows at the required location.However when im streaming the table into excel file it is starting from the extreme left corner .i Tried this one Response.Write(" " & "
sameer
") however it didnt work. Any help is greatly appreciated :doh:
modified on Friday, February 13, 2009 12:51 PM