找回密码
 立即注册

QQ登录

只需一步,快速开始

硕王

论坛元老

17

主题

70

帖子

1万

积分

论坛元老

积分
11075

活字格认证

硕王
论坛元老   /  发表于:2015-4-25 10:02  /   查看:4184  /  回复:1
区域报表导出怎么是空白页,如图

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x

1 个回复

倒序浏览
frank.zhang
社区贡献组   /  发表于:2015-4-27 09:45:00
沙发
您好,
在区域报表已经可以正常运行的前提下,增加button按钮。
  1.         protected void Button4_Click(object sender, EventArgs e)
  2.         {
  3.             Reports.SectionReport1 rpt = new Reports.SectionReport1();
  4.             rpt.Run();

  5.             GrapeCity.ActiveReports.Export.Excel.Section.XlsExport XlsExport1 = new GrapeCity.ActiveReports.Export.Excel.Section.XlsExport();

  6.             System.IO.MemoryStream ms = new System.IO.MemoryStream();
  7.             XlsExport1.FileFormat = GrapeCity.ActiveReports.Export.Excel.Section.FileFormat.Xlsx;
  8.             XlsExport1.Export(rpt.Document, ms);
  9.             ms.Position = 0;

  10.             Response.ContentType = "application/vnd.ms-excel";
  11.             Response.AddHeader("content-disposition", Server.UrlPathEncode("attachment;filename=MyExport.xlsx"));
  12.             Response.BinaryWrite(ms.ToArray());
  13.             Response.End();
  14.         }
复制代码

评分

参与人数 1满意度 +5 收起 理由
硕王 + 5 谢谢

查看全部评分

回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部