Crystal报告错误。该报告没有表格

时间:2015-03-04 10:49:24

标签: asp.net c#-4.0 crystal-reports

我正在使用空白水晶报告并绑定我的数据集。它显示报告没有表错误。

 string strSQL = "Select * from EMP"; //WHERE EMPNO='" + txtEmpId.Text + "'
 OracleDataAdapter dt = new OracleDataAdapter(strSQL, scon);
 DataSet ds = new DataSet();
 dt.Fill(ds, "EMP");

 ReportDocument cryRpt = new ReportDocument();
 cryRpt.FileName = Server.MapPath("~/Reports/DailyReport.rpt");
 cryRpt.SetDataSource(dt);

 CrystalReportViewer1.ReportSource = cryRpt;
 scon.Close();

1 个答案:

答案 0 :(得分:0)

尝试使用以下代码

 string strSQL = "Select * from EMP"; //WHERE EMPNO='" + txtEmpId.Text + "'
 OracleDataAdapter da = new OracleDataAdapter(strSQL, scon);
 DataSet ds = new DataSet();
 DataTable dt = new DataTable("DT_CR");
 da.Fill(dt);
 ds.Tables[0].Merge(dt);
 ReportDocument cryRpt = new ReportDocument();
 cryRpt.FileName = Server.MapPath("~/Reports/DailyReport.rpt");
 cryRpt.SetDataSource(ds);
 CrystalReportViewer1.ReportSource = cryRpt;
 scon.Close();