Windows窗体应用程序错误和Crystal Report [英] Windows form application error with crystal report

查看:178
本文介绍了Windows窗体应用程序错误和Crystal Report的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Windows窗体应用程序的新手.这是我在办公室的第一个应用程序. 我的办公室管理层为我提供了源代码.但是他们对此一无所知.

I'm a novice in the windows form application. It's my first application at the office. My office management gives me the source code. But they don't know anything about it.

我在Visual Studio 12(64位)上运行这些代码.一切都在运行,但是水晶报表无法正常工作.引发错误.

I run those codes on visual studio 12 (64 bit). Everything is running, but the crystal report is not working. Throws error.

错误是:

无法转换类型为COM的对象 将'CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass'更改为 接口类型 "CrystalDecisions.ReportAppServer.Controllers.ISCRReportSource".这 操作失败,因为对COM组件的QueryInterface调用 用于具有IID'{98CDE168-C1BF-4179-BE4C-F2CFA7CB8398}'的接口 由于以下错误而失败:不支持此类接口 (来自HRESULT的异常:0x80004002(E_NOINTERFACE)).

Unable to cast COM object of type 'CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass' to interface type 'CrystalDecisions.ReportAppServer.Controllers.ISCRReportSource'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{98CDE168-C1BF-4179-BE4C-F2CFA7CB8398}' failed due to the following error: No such interface supported (Exception from 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;

任何人都可以给我详细的解决方案吗?

Can anyone give me a solution elaborately?

推荐答案

现在,我也发生了同样的问题.

The same problem occured with me too, right now.

当我安装CR 13 Update 21时,我的项目在运行时给出了相同的异常.

When I installed CR 13 Update 21, my project gave the same exception during runtime.

我刚刚从解决方案资源管理器中删除了CrystalDecision的所有引用(它们实际上属于CR的早期版本,即CR 13 Update 20).

I just removed all of the references of CrystalDecision from Solution Explorer (which actually belonged to a previous version of CR i.e. CR 13 Update 20).

然后我从Solution Explorer => References => Add Reference菜单添加了新的引用.我从窗口中选择了所需的CrystalDecision软件包.重建,问题现在消失了.

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.

这篇关于Windows窗体应用程序错误和Crystal Report的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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