private void Export_Click(object sender, System.EventArgs e)
{
HttpContext.Current.Response.AppendHeader("Content-Disposition", "attachment;filename=matArrivedReport.xls");
HttpContext.Current.Response.Charset = "gb2312";
HttpContext.Current.Response.ContentEncoding= System.Text.Encoding.UTF7;
HttpContext.Current.Response.ContentType = "application/ms-excel";
System.IO.StringWriter strWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new System.Web.UI.HtmlTextWriter(strWrite);
htmlWrite.Write("<table width=\"100%\"><tr><td width=\"100%\" align=\"center\" colspan=\"9\"><span style=\"FONT-SIZE: 28px; FONT-FAMILY: 黑体\"><p>****汇总表</p></span></td></tr></table>");
Repeater1.RenderControl(htmlWrite); //这里是活动内容,你可以从窗体中任何控件获取字符流
HttpContext.Current.Response.Write(strWrite.ToString());
HttpContext.Current.Response.End();
}
#endregion