水晶报告中没有数据显示。哪里是错误。 ?帮助我。 THANX [英] no data is displaying in crystal report. where is error. ? help me with this. ThanX
本文介绍了水晶报告中没有数据显示。哪里是错误。 ?帮助我。 THANX的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
String query = "Select a.Account_No,d.Transaction_No,d.Amount_Debit,d.Debit_Date,d.Total_Amount_Debit,c.Transaction_No,c.Amount_Credit,c.Credit_Date,c.Total_Amount_Credit from Account_Debit d,Account_Credit c,Accounts a where c.Account_No=d.Account_No and d.Transaction_No=c.Transaction_No";
da = new SqlDataAdapter(query, cn);
DataTable dt = new DataTable();
da.Fill(dt);
if (dt.Rows.Count == 0)
{
MessageBox.Show("The Complete Info of Account No''" + cboaccount1.Text + "-" + cboaccount2.Text + "''does not Exists!!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
cboaccount1.SelectAll();
cboaccount1.Focus();
}
else
{
DebitCrdit_rpt crt = new DebitCrdit_rpt();
crt.SetDataSource(dt);
Report_Viewer rpt = new Report_Viewer();
this.Close();
rpt.Show();
rpt.crystalReportViewer1.ReportSource = crt;
rpt.crystalReportViewer1.Refresh();
dt.Clear();
cn.Close();
}
}
}
推荐答案
in else part ...
in else part...
ReportDocument crt=New ReportDocument();
crt.Load("PUT CRYSTAL REPORT PATH HERE\DebitCrdit_rpt.rpt")
Report_Viewer rpt = new Report_Viewer();
crt.SetDataSource(dt);
crt.Database.Tables(0).SetDataSource(dt);
rpt.crystalReportViewer1.ReportSource = crt;
rpt.crystalReportViewer1.Refresh();
this.Close();
rpt.Show();
cn.Close();
快乐编码!
:)
Happy Coding!
:)
可以你在下面替换你的其他部分
Could you replace your else part below
else
{
DebitCrdit_rpt crt = new DebitCrdit_rpt();
crt.SetDataSource(dt);
Report_Viewer rpt = new Report_Viewer();
this.Close();
rpt.Show();
rpt.crystalReportViewer1.ReportSource = crt;
rpt.crystalReportViewer1.Refresh();
dt.Clear();
cn.Close();
}
with
with
else
{
DebitCrdit_rpt crt = new DebitCrdit_rpt();
crt.SetDataSource(dt);
rpt.crystalReportViewer1.ReportSource = crt;
rpt.crystalReportViewer1.Refresh();
dt.Clear();
cn.Close();
}
并且应该有效,任何问题让我知道
and should work, any issues let me kow
这篇关于水晶报告中没有数据显示。哪里是错误。 ?帮助我。 THANX的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文