我正在使用空白水晶报告并绑定我的数据集。它显示报告没有表错误。
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();
答案 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();