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

2003 报表 会的帮个忙啊
SqlConnection   conn=new   SqlConnection( "data   source=server;initial   catalog=Northwind;user   id=sa;password= ' ' ");
DataSet   ds   =   new   DataSet();

SqlDataAdapter   da1=new   SqlDataAdapter( "select   *   from   orders ",conn);
da1.Fill(ds, "orders ");
CrystalReport3   oCR=new   CrystalReport3();
oCR.SetDataSource(ds);
this.crystalReportViewer2.ReportSource   =   oCR;

这样写什么出现的报表显示的是空白啊!


是不是报表(CrystalReport3)还需要设计什么的啊!


------解决方案--------------------
Rpt.account_report rpt1=new webform.Customer_Pay.Rpt.account_report();
try
{
rpt1.SetDataSource(Dcpfcp.get_account_report(Session[ "user "].ToString() ));
}
catch(Exception ex)
{
this.errmsgbox.Value =ex.Message;
}
this.CrystalReportViewer1.ReportSource=rpt1;
------解决方案--------------------
帮顶!
------解决方案--------------------
oCR.SetDataSource(ds.Tables[ "orders "]);

------解决方案--------------------
up
------解决方案--------------------
问题应该不出在这段代码,报表页面你是怎么做的?
------解决方案--------------------
mark,共同学习。
------解决方案--------------------
在你的项目中有CrystalReport3.cs这个文件吗?
该文件是你往项目中添加CrystalReport3报表时自动生成的.没有的话你要在资源管理器中重新添加报表,或者是你的水晶报表出了问题,它不能自动生成这个文件.