Teraz używam tego wyeksportować Repeater (z wielu zagnieżdżonych repeaterów) excel:Eksportować do programu Excel z repeatera?
protected void ExportToExcel(object sender, EventArgs e)
{
Response.Clear();
Response.Buffer = true;
Response.AddHeader("content-disposition", "attachment;filename=finance.xls");
Response.Charset = "";
Response.ContentType = "application/vnd.ms-excel";
System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
rptMinistry.RenderControl(htmlWrite);
Response.Write(stringWrite.ToString());
Response.End();
}
Ale to nie robi tego, co chcę. Zamiast tego daje mi html w pliku excel (choć dane są tam) to co mam (każdy wiersz jest komórka w arkuszu Excel):
<tr class="alt">
<td class='hidden'>LOR In Development</td>
<td>MOD</td>
<td>Air Force</td>
<td class="size1"></td>
<td>Hellfire (AGM-114) Follow On</td>
<td>10-Mar-08</td>
<td class="align_right ">$50,000,000.00</td>
<td class="align_right hidden">$0.00</td>
</tr>
<tr class="alt">
<td class='hidden'>LOR In Development</td>
<td>MOD</td>
<td>Air Force</td>
<td class="size1"></td>
<td>Precision Strike Mi-17 (block 20)</td>
<td>17-May-08</td>
<td class="align_right ">$20,100,000.00</td>
<td class="align_right hidden">$0.00</td>
</tr>
i tak dalej ... teraz dane jest poprawny, ale jak mogę go poprawnie wyświetlić w arkuszu kalkulacyjnym?
tak proste ... Nie mogę uwierzyć, że brakowało mi, dzięki! – naspinski