找回密码
 立即注册

QQ登录

只需一步,快速开始

Young

高级会员

9

主题

32

帖子

1839

积分

高级会员

积分
1839

活字格认证

Young
高级会员   /  发表于:2013-9-17 20:10  /   查看:4645  /  回复:1
使用SectionReport报表数据导出有问题,请问要怎么解决

本帖子中包含更多资源

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

x

1 个回复

倒序浏览
ZenosZeng讲师达人认证 悬赏达人认证
超级版主   /  发表于:2013-9-18 09:19:00
沙发
回复 1楼Young的帖子

请参考以下代码:

  1.     protected void btnExcel_Click(object sender, EventArgs e)
  2.     {
  3.         SectionReport1 section = new SectionReport1();
  4.         section.UnboundDataSource = GetData1();
  5.         section.Run();

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

  11.         Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
  12.         Response.AddHeader("content-disposition", Server.UrlPathEncode("attachment;filename=客户订单.xlsx"));
  13.         Response.BinaryWrite(ms.ToArray());
  14.         Response.End();

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