该报告在C#中没有表格错误 [英] The report has not tables error in c#

查看:74
本文介绍了该报告在C#中没有表格错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Crystal Report比较新鲜.
我正在使用Sql Server 2005作为后端.
在另一个窗体上的按钮的单击事件上,我通过ShowDialog方法显示frmCrLedRep窗体.
当触发点击事件并加载frmCrLedRep表单时,我发现错误报告无表".我在frmCrLedRep表单的load事件上编写了以下代码:-

I am fresher to Crystal Report.
I am using Sql Server 2005 as backend.
On a click event of a button on another form I shows the frmCrLedRep form by ShowDialog Method.
When click event fires and frmCrLedRep form being load, then I found Error "The report has no tables". I have write following code on load event of frmCrLedRep form :-

private void frmCrLedRep_Load(object sender, EventArgs e)
        {
            frmMain.adap=new SqlDataAdapter("select * from ledger where idacmast="+idacname+" order by date",frmMain.con);
            DataSet ds=new DataSet();
            frmMain.adap.Fill(ds,"ledger");
            CrystalReport3 report = new CrystalReport3();
            report.SetDataSource(ds.Tables["ledger"]);
            crystalReportViewer1.ReportSource = report;
            crystalReportViewer1.RefreshReport();
}


我在frmCrLedRep表单顶部使用以下引用


I am using following references on top of frmCrLedRep form

using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared.Interop;





请帮助我





Please Help me

推荐答案

选中此
推送方法和报告没有表"异常 [
Check this
Push method and "The report has no tables" exception[^]


这篇关于该报告在C#中没有表格错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆