关于水晶报表10 的字报表数据填充和显示,关于水晶报表10 的字报表数据填充和显示
【 tulaoshi.com - ASP 】
水晶报表10版本,不再上水晶报表9一样自动帮你给子报表set 记录集,需要你在程序中自己添加protected CrystalDecisions.Web.CrystalReportViewer CrystalReportViewer1;
(本文来源于图老师网站,更多请访问http://www.tulaoshi.com/asp/)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;
来源:http://www.tulaoshi.com/n/20160129/1510360.html
看过《关于水晶报表10 的字报表数据填充和显示》的人还看了以下文章 更多>>
如果您有什么好的建议或者疑问,可以联系我们。 商务合作QQ:3272218541;3282258740。商务合作微信:13319608704;13319603564。
加好友请备注机构名称。让我们一起学习、一起进步tulaoshi.com 版权所有 © 2019 All Rights Reserved. 湘ICP备19009391号-3
微信公众号