你把datagridview的数据源转换成datatable看下,还有你就是要确认你的数据源中是否有数据
myReport.SetDataSource(datatable); 

解决方案 »

  1.   


    到此处你看下数据源是否有值
    如果有
    可能是你没给保镖浏览器指定报表源文件下面偷阿泰段代码 ReportDocument myReport = new ReportDocument();
                string reportPath = System.Threading.Thread.GetDomain().BaseDirectory + "crystalreport1.rpt";
                myReport.Load(reportPath);            //绑定数据集,注意,一个报表用一个数据集。            myReport.SetDataSource(dataSet);
               
                crystalReportViewer1.ReportSource = myReport;
                crystalReportViewer1.RefreshReport();
      

  2.   

    这样看一下
    dataSet = new DataSet(); 
    dt.tablename="跟水晶报表设计时的表名要一致";
    dataSet.Tables.Add(dt.Copy()); 
    if (dataSet != null) 
    { //myReport.SetDataSource(dataSet); 
    myReport.SetDataSource(dataSet.Tables[0]); 

    this.crystalReportViewer1.ReportSource = myReport; 
      

  3.   

    各位老大们啊
    我的dataset中的数据在数据库中的没有对应的表啊,是自己程序中逻辑计算出来的啊
    3,4,5楼的兄弟给的代码有什么用啊
    问题核心概括:
    dataset中的数据在数据库中的没有对应的表,如何设计水晶报表并通过水晶报表打印数据?