I have used your concept to get the code to sort of work. I seem to be having an issue displaying the footer of my code. the footer calculates a total of the columns.
The code works when I comment the footer out. If anyone knows why this might be or could help that would be great.
Thanks
Protected Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Response.Clear()
Response.Buffer = True
Response.AddHeader("content-disposition", "attachment;filename=RepeaterExport.xls")
Response.Charset = ""
Response.ContentType = "application/vnd.ms-excel"
Dim sw As New StringWriter()
Dim hw As New HtmlTextWriter(sw)
Dim tb As New Table()
Dim tr1 As New TableRow()
Dim cell1 As New TableCell()
cell1.Controls.Add(Rpt1)
tr1.Cells.Add(cell1)
Dim cell3 As New TableCell()
cell3.Controls.Add(Rpt2)
Dim cell2 As New TableCell()
cell2.Text = " "
tr1.Cells.Add(cell2)
tr1.Cells.Add(cell3)
tb.Rows.Add(tr1)
tb.RenderControl(hw)
Response.Output.Write(sw.ToString())
Response.Flush()
Response.End()
End Sub
<FooterTemplate>
<tr>
<td></td>
<td></td>
<td>
<asp:TextBox CssClass="ttl" ReadOnly="true" ID="Label1" runat="server"></asp:TextBox></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>
<asp:TextBox CssClass="ttl" ReadOnly="true" ID="Label2" runat="server"></asp:TextBox></td>
<td>
<asp:TextBox CssClass="ttl2" ReadOnly="false" ID="Label3" runat="server"></asp:TextBox></td>
<td>
<asp:TextBox CssClass="ttl2" ReadOnly="true" ID="Label4" runat="server"></asp:TextBox></td>
</tr>
</table>
</FooterTemplate>
</asp:Repeater>