CrystalReportAct crt = new CrystalReportAct();
sqlcon.Open();
sql = "SELECT EmpLog.Date, JobCategory.JobDesc,
Client.CompDesc, Product.ProdName, EmpLog.Actions, EmpLog.Remarks
FROM Client
INNER JOIN EmpLog ON Client.CompCode = EmpLog.CompCode
INNER JOIN JobCategory ON EmpLog.JobCode = JobCategory.JobCode
INNER JOIN Product ON EmpLog.ProdCode = Product.ProdCode
WHERE (EmpLog.EmpID = '"+empID+"')";
SqlDataAdapter adp = new SqlDataAdapter(sql, sqlcon);
DataSet ds = new DataSet();
adp.Fill(ds, "Client");
adp.Fill(ds, "Emplog");
adp.Fill(ds, "JobCategory");
adp.Fill(ds, "Product");
crt.SetDataSource(ds);
crystalReportViewer1.ReportSource = crt;
这运行但输出错误。输出几乎是 80 行,而不仅仅是 3 行。