日期:2014-05-20  浏览次数:20726 次

reportviewer的具体用法
各位前辈: 
  小弟我用vs2008的reportviewer控件做报表,但遇到一个"无法显示子报表"的问题。 
从昨晚到现在都还没有搞定,心情很急,也没有头绪,觉得很无助。

不知道reportviewer的具体用法是什么样的呢,

------解决方案--------------------
可以去www.cnblogs.com搜搜
------解决方案--------------------
up,还在用2005呢~
------解决方案--------------------
你好,报表首先要分客户端和服务器端的,无论是哪种模式,首先要确定你的报表设计没有错误,可以在报表设计器里多调试一下。
------解决方案--------------------
你用了什么子报表?
REPORTVIEW只是显示表表而已。

------解决方案--------------------
关注下
------解决方案--------------------
是在做钻取的时候吧,说说具体的情况。
------解决方案--------------------
额- -,复制贴?
------解决方案--------------------
报表中有子报表时,需添加LocalReport.SubreportProcessing方法来给子报表传递数据源
------解决方案--------------------
private ReportDocument repDoc = new ReportDocument(); 
方法:
//获取主报表的数据源
DataTable oTable = Table//主表数据源
string FilePath = Server.MapPath("主表路径");
//获取子报表的数据源
DataTable Table1 = Table1//字表数据源
if (!repDoc.IsLoaded)
{
CrystalReportSource1.ReportDocument.Load(FilePath);
ReportDocument doc1 = CrystalReportSource1.ReportDocument.OpenSubreport("子报表");
if (doc1 != null)
{
doc1.SetDataSource(Table1);
}
CrystalReportSource1.ReportDocument.SetDataSource(oTable);
CrystalReportViewer1.ReportSource = repDoc;
CrystalReportViewer1.DataBind();
}