找不到类型或命名空间名称“ReportDocument” [英] The type or namespace name 'ReportDocument' could not be found

查看:102
本文介绍了找不到类型或命名空间名称“ReportDocument”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好



我在生成报告时遇到错误

错误如




错误2找不到类型或命名空间名称'ReportDocument'(您是否缺少using指令或程序集引用?)E:\New folder \ Vinay \ FB_BILLING\FBB_Reports.cs 23 9







错误3类型或命名空间名称'Tables'找不到(你错过了使用指令或汇编引用吗?)E:\New folder \Vinay \FB_BILLING \FBB_Reports.cs 24 9 FB_BILLING



错误5找不到类型或命名空间名称TableLogOnInfos(您是否缺少using指令或程序集引用?)E:\New folder \Vinay \FB_BILLING \FBB_Reports.cs 26 9 FB_BILLING



错误7找不到类型或命名空间名称'ConnectionInfo'(您是否缺少using指令或程序集引用?)E: \New folder\Vinay\FB_BILLING\FBB_Reports.cs 28 9 FB_BILLING





即使我包含类似指令

使用System.Data;

使用System.Drawing;

使用System.Linq;

使用System.Text;

使用System.Windows.Forms;

使用System.Data.SqlClient;

使用CrystalDecisions.CrystalReports.Engine ;

使用CrystalDecisions.Shared;

使用System.IO;





请说明可能发生的错误。

hi all

I got an error while generating the report
error like


Error 2 The type or namespace name 'ReportDocument' could not be found (are you missing a using directive or an assembly reference?) E:\New folder\Vinay\FB_BILLING\FBB_Reports.cs 23 9



Error 3 The type or namespace name 'Tables' could not be found (are you missing a using directive or an assembly reference?) E:\New folder\Vinay\FB_BILLING\FBB_Reports.cs 24 9 FB_BILLING

Error 5 The type or namespace name 'TableLogOnInfos' could not be found (are you missing a using directive or an assembly reference?) E:\New folder\Vinay\FB_BILLING\FBB_Reports.cs 26 9 FB_BILLING

Error 7 The type or namespace name 'ConnectionInfo' could not be found (are you missing a using directive or an assembly reference?) E:\New folder\Vinay\FB_BILLING\FBB_Reports.cs 28 9 FB_BILLING


even I include directives like
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
using System.IO;


Please tell what mistake might be happen.

推荐答案

您好b $ b

您在代码块的开头没有mansion名称空间



试试这个。



Hi
you have not mansion namespace in beginning of the code block

Try this.

using CrystalDecisions.CrystalReports.Engine;

// This is for CrystalReport "ReportDocument" keyword







如果上面的代码行不起作用那么你应该为你的项目添加dll或名字空间或安装水晶报告。



希望这会帮助你。



不要忘记将此标记为解决方案它是。



Happy Codding ......

Nayan Chavada




if above line of code not work then you should have to add dll or name space to your project or install crystal report.

Hope this will Help you.

Don't forgot to mark this as solution if it is.

Happy Codding...
Nayan Chavada


你是否添加了参考文献是不是......?



如果您忘记添加dll,请添加。



如果已经添加了dll,那么请检查它是否添加到确切的位置。
Are you added the reference dll's or not...?

If you forgot to add the dll's , please be added .

If already the dll has been added , then please check it that, is it added in exact location or not.


rpt1 custReport = new rpt1();你不能直接使用rpt1 ..



试试这样



{

ReportDocument rpt = new ReportDocument();

rpt.Load(@C:\rp1.rpt);

rpt.Database.Tables [ 0] .SetDataSource(ds_xml);

crystalReportViewer1.ReportSource = rpt;

}
rpt1 custReport = new rpt1(); You can't use the rpt1 directly..

try like this

{
ReportDocument rpt = new ReportDocument();
rpt.Load(@"C:\rp1.rpt");
rpt.Database.Tables[0].SetDataSource(ds_xml);
crystalReportViewer1.ReportSource = rpt;
}


这篇关于找不到类型或命名空间名称“ReportDocument”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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