载入水晶报告错误 [英] Load crystal report error

查看:80
本文介绍了载入水晶报告错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

先生,
我使用Visual Studio 2010开发ASP.NET,原因是使用水晶报表查看器在网页中显示报表,因为我出错了,
无效的报告来源".
在此行错误得到... "CrystalReportViewer1.ReportSource = oRpt;"

编码:

hi sir,
I am using a Visual studio 2010 for developing ASP.NET in that using a crystal report viewer to display report in web page in that i got error ,
"Invalid Report Source".
in this line error got ... "CrystalReportViewer1.ReportSource = oRpt;"

Coding:

oRpt.Load(Server.MapPath("CrystalReport2.rpt;));
//set dataset to the report viewer.
oRpt.SetDataSource(ds);

CrystalReportViewer1.ReportSource = oRpt;

//CrystalReportViewer1.RefreshReport();
//CrystalReportViewer1.DataBind();
 }


请告诉您该报告来源行中的错误是什么
请回复...

在此先感谢.......


please tell what is the error in that line of report source
please reply......

Thanks in advance.......

推荐答案

您的代码没有错.当您在项目中引用了不同版本的CR dll时,通常会出现此错误.再次检查并确认您使用的版本正确.应该可以解决您的问题.
There is nothing wrong in the code that you have. This error usually is seen when you have different versions of CR dlls being referenced in your project. Check and verify again that you are using correct version..that should solve your problem.


作为prdshukla回答的补充,您可能要检查Server.MapPath("CrystalReport2.rpt)是实际的文件夹路径,并且存在.听起来很明显,但是您不想知道有多少人在下午调试文件名时丢失了C:\ MyFolder \ \ MyFile.rpt或C:\ MyFolderMyFile.rpt (没有\),甚至C:\ MyFolder \ MyFile.rpt \
还要确保在尝试加载报表时未在CrystalReports中打开该报表.不确定所有版本是否有问题,但您最好确保.
As an addition to prdshukla''s answer you might want to check if the Server.MapPath("CrystalReport2.rpt") is an actual folder path and exists. It sounds so obvious, but you don''t want to know how many people have lost afternoons debugging filename''s such as C:\MyFolder\\MyFile.rpt or C:\MyFolderMyFile.rpt (no \) or even C:\MyFolder\MyFile.rpt\
Also make sure the report is not open in CrystalReports when trying to load it. Not sure if it''s a problem with all versions, but you''d best make sure.


这篇关于载入水晶报告错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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