Autofilter headers with dynamic html

A

Amy B

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top