FaaliyetList = new BusinessManager().SEARCH_FAALIYET(strBaslangicTarihi, strBitisTarihi, strIl, FaaliyetTipiId);
StringBuilder icerik = new StringBuilder();
icerik.Append("<table border='1'>" +
"<tr style='text-align:center; font-weight: bold; background-color: black; color: white;'>" +
"<td>Nitelik</td>" +
"<td>İl</td>" +
"<td>Faaliyet Tipi </td>"+
"<td>Baslangıç Tarihi</td>" +
"<td>Bitiş Tarihi</td>" +
"</tr>"
);
foreach (var item in FaaliyetList)
{
icerik.Append("<tr>");
icerik.Append("<td>" + item.Id.ToString() + "</td>");
icerik.Append("<td>" + item.Nitelik + "</td>");
icerik.Append("<td>" + item.FaaliyetTipiAdi + "</td>");
icerik.Append("<td>" + item.BaslangicTarihi.ToShortDateString() + "</td>");
icerik.Append("<td>" + item.BitisTarihi.ToShortDateString() + "</td>");
icerik.Append("</tr>");
}
icerik.Append("</table>");
Response.Clear();
Response.ClearHeaders();
Response.ClearContent();
Response.Cache.SetCacheability(
HttpCacheability.NoCache);
Response.ContentEncoding = System.Text.
Encoding.GetEncoding("windows-1254");
Response.Charset =
"windows-1254";
Response.Buffer =
true;
this.EnableViewState = false;
Response.ContentType =
"application/vnd.xls";
string filename = "Stok_" + System.DateTime.Now.ToShortDateString() + ".xls";
Response.AddHeader(
"content-disposition", "attachment;filename= " + filename);
string header = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<title></title>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1254\" />\n<style>\n</style>\n</head>\n<body>\n";
Response.Write(header + icerik);
Response.End();