当前位置: 首页 > 图文教程 > 网络编程 > ASP > 关于水晶报表10 的字报表数据填充和显示

ASP
看人家用使用InstallShield制作ASP安装程序(5)
看人家用使用InstallShield制作ASP安装程序(4)
看人家用使用InstallShield制作ASP安装程序(3)
看人家用使用InstallShield制作ASP安装程序(2)
看人家用使用InstallShield制作ASP安装程序(1)
取得浏览者的离开时间
base64编码、解码函数
动态显示图片的函数(显示广告条)
发送带附件的HTML格式邮件例程可以带附件
一种在父窗口中得知window.open()出的子窗口关闭事件的方法
一个老个写的无组件上传
避免asp的SQL的执行效率低
树型结构在ASP中的简单解决
无需数据库循环的无级分类代码
检查字符串strSource是否为big或big5码
有关重复记录的删除(SQL SERVER)
WINDOWS2000服务器账号登陆身份验证
使用VC++6.0制作ASP服务器控件简介
利用sql的存储过程实现dos命令的asp程序
WSH 直接将查询数据结果生成 EXCEL 表

ASP 中的 关于水晶报表10 的字报表数据填充和显示


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 44 ::
收藏到网摘: n/a

  水晶报表10版本,不再上水晶报表9一样自动帮你给子报表set 记录集,需要你在程序中自己添加

protected CrystalDecisions.Web.CrystalReportViewer CrystalReportViewer1;

DataSet newDs = new DataSet();
     。

     。得到报表的数据集合set给newsDs

   DataSet  dstMain=biz.GetDataSetList(pStart, pEnd, pStoreName);
 newsDs.Tables.Add(dstMain.Tables[0].Copy());//添加主报表数据集

   DataSet dstPOS1 = new DataSet();
      DataSet dstPOS2 = new DataSet();
      dstPOS1 = biz.GetDataSetList(pStart, pEnd, pStoreName1);
      dstPOS2 = biz.GetDataSetList(pStart, pEnd, pStoreName2);
      newsDs.Tables.Add(dstPOS1.Tables[0].Copy());//添加子报表数据集
      newsDs.Tables.Add(dstPOS2.Tables[0].Copy());//添加子报表数据集

    。

  Type m_Report_type  = m_Assembly.GetType(ReportClassName);//ReportClassName是报表名
     Object aa = m_Assembly.CreateInstance(m_Report_type.FullName);
     ReportClass reportEngine  = (ReportClass)m_Assembly.CreateInstance(m_Report_type.FullName);

   for(int i=1;i<newDs.Tables.Count;i++)//给子报表赋值
     {
      ReportDocument oSubreport=reportEngine.Subreports[i-1];
      oSubreport.SetDataSource(newDs);
     }

     reportEngine.SetDataSource( newDs );
     CrystalReportViewer1.ReportSource = reportEngine;
     return;