gridview
发表在C#图书答疑
2009-06-29
是否精华
是
否
版块置顶:
是
否
设置时间:
非永久
永久
起始时间:
结束时间:
是否扣分:
是
否
我按照
精彩评论 11
2009-06-30
沙发
Response.Charset = "GB2312";
Response.ContentEncoding = System.Text.Encoding.UTF7;
Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode("Settlement_Searching_History.xls", System.Text.Encoding.UTF8).ToString());
Response.ContentType = "application/ms-excel";
this.EnableViewState = false;
StringWriter tw = new StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(tw);
GridView1.RenderControl(hw);
Response.Write(tw.ToString());
Response.Flush();
Response.End();
public override void VerifyRenderingInServerForm(Control control) { }
Response.ContentEncoding = System.Text.Encoding.UTF7;
Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode("Settlement_Searching_History.xls", System.Text.Encoding.UTF8).ToString());
Response.ContentType = "application/ms-excel";
this.EnableViewState = false;
StringWriter tw = new StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(tw);
GridView1.RenderControl(hw);
Response.Write(tw.ToString());
Response.Flush();
Response.End();
public override void VerifyRenderingInServerForm(Control control) { }
2009-06-30
6L
我是按书上敲的,根书上没有不同,
你帮忙看下,那数据源那是不是地方写错了。
Report report = new Report();
System.Data.DataTable dt = report.Get_Settlement_Searching_History(fromdate, todate, customer_code, source).Tables[0];
this.GridView1.DataSource = dt;
this.GridView1.DataBind();
Response.Charset = "GB2312";
Response.ContentEncoding = System.Text.Encoding.UTF7;
Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode ("Settlement_Searching_History.xls", System.Text.Encoding.UTF8).ToString());
Response.ContentType = "application/ms-excel";
this.EnableViewState = false;
StringWriter tw = new StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(tw);
GridView1.RenderControl(hw);
Response.Write(tw.ToString());
Response.Flush();
Response.End();
public override void VerifyRenderingInServerForm(Control control) { }
这是 我的代码,帮忙看下有没有错 , ,,,
谢谢了
你帮忙看下,那数据源那是不是地方写错了。
Report report = new Report();
System.Data.DataTable dt = report.Get_Settlement_Searching_History(fromdate, todate, customer_code, source).Tables[0];
this.GridView1.DataSource = dt;
this.GridView1.DataBind();
Response.Charset = "GB2312";
Response.ContentEncoding = System.Text.Encoding.UTF7;
Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode ("Settlement_Searching_History.xls", System.Text.Encoding.UTF8).ToString());
Response.ContentType = "application/ms-excel";
this.EnableViewState = false;
StringWriter tw = new StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(tw);
GridView1.RenderControl(hw);
Response.Write(tw.ToString());
Response.Flush();
Response.End();
public override void VerifyRenderingInServerForm(Control control) { }
这是 我的代码,帮忙看下有没有错 , ,,,
谢谢了