View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Amy B[_2_] Amy B[_2_] is offline
external usenet poster
 
Posts: 2
Default Autoformat headers with dynamic

Hi,

I am using the code below to dynamically build an html table and write
it to excel an excel spreadsheet. This code works great except that I
need the headers use AutoFilter on the headers, but I can't figure out
how to perform this. I have a template that has the headers with
autofilter turned on, but when I click on the cell, no formula is
displayed.

sb.Append("<tr<td align=""center""")
sb.Append(dr.Item("FirstName").ToString.Trim)
sb.Append("</td<td")
sb.Append(dr.Item("LastName").ToString.Trim)
sb.Append("</td<td")
sb.Append(dr.Item("Store"))
sb.Append("</td<td")
sb.Append(dr.Item("OOQ"))
sb.Append("</td<td")
sb.Append(dr.Item("FOQ"))
sb.Append("</td<td")
sb.Append(dr.Item("Diff"))
sb.Append("</td</tr")
sb.Append(vbCrLf)

Response.AddHeader("content-Type", "application/ms-excel")
Response.AddHeader("content-disposition", "attachment;
filename=OrderstagingperformanceReport.xls")
Response.AddHeader("Content-Length", sb.Length)
Response.Write(sb.ToString())

When I view the source of a correct spreadsheet with data, the td for
the FirstName column is:

<td height=18 class=xl24 id="_x0000_s1025" x:autofilter="all"
x:autofilterrange="$A$1:$F$1" width=94
style='height:13.5pt;width:71pt'FistName</td

I'm just not sure how to get this into my dynamic html. Any
suggestions and/or examples would be greatly appreciated!

Thanks,
Amy B