日期:2014-05-17  浏览次数:20507 次

取消报表下载问题
private void Export(string FileType, string FileName)
  {
  Response.Charset = "GB2312";
  Response.ContentEncoding = System.Text.Encoding.UTF7;
  Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(FileName,Encoding.UTF8).ToString());
  Response.ContentType = FileType;
  this.EnableViewState = false;
  StringWriter tw = new StringWriter();
  HtmlTextWriter hw = new HtmlTextWriter(tw);
  this.GridView2.RenderControl(hw);
  Response.Write(tw.ToString());
  Response.End();
  }
  public override void VerifyRenderingInServerForm(Control control)
  {
  }
找的这段导出EXCL代码。
我点报表后 取消下载,会自动关闭页面。能取消后不关闭页面么?

------解决方案--------------------
楼主是已经开始导出了吗?如果是,导出报表的时候不是瞬时间的事吗?哪有点击取消的时间啊~