我是Windows窗体应用程序的新手。这是我在办公室的第一次申请。
我的办公室管理人员给了我源代码。但他们对此一无所知。
我在 Visual Studio 12(64 位)上运行这些代码。一切都在运行,但水晶报表不起作用。抛出错误。
错误是:
无法转换 COM 对象类型
'CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass' 至
接口类型
'CrystalDecisions.ReportAppServer.Controllers.ISCRReportSource'。这
操作失败,因为 COM 组件上的 QueryInterface 调用
对于 IID 为“{98CDE168-C1BF-4179-BE4C-F2CFA7CB8398}”的接口
由于以下错误而失败:不支持此类接口
(HRESULT 异常:0x80004002 (E_NOINTERFACE))。
这里是截屏:
这是代码:
ReportDAL rDal = new ReportDAL();
receipt r = new receipt();
DataTable dt = rDal.GetInvoiceHeader(vId);
//string ww = GetInvoiceHeader(vId);
r.Database.Tables["ReceiptDetails"].SetDataSource(rDal.GetInvoiceDetails(vId));
r.Database.Tables["ReceiptHeader"].SetDataSource(rDal.GetInvoiceHeader(vId));
r.SetParameterValue("pReportDeliveryTime", GlobalData.reportDeliveryTime);
crystalReportViewer1.ReportSource = r;
谁能给我一个详细的解决方案吗?
我现在也出现了同样的问题。
当我安装 CR 13 Update 21 时,我的项目在运行时出现了相同的异常。
我刚刚从解决方案资源管理器中删除了 CrystalDecisions 的所有引用(实际上属于 CR 的早期版本,即 CR 13 Update 20)。
Then I added fresh references from Solution Explorer => References => Add Reference
menu. I selected the required CrystalDecision
packages from the window. Rebuilt, and the problem is gone now.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)