且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

找不到类型或命名空间名称“ReportDocument”

更新时间:2023-02-16 14:19:42

您好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;
}