gpt4 book ai didi

c# - Windows 窗体应用程序错误与 Crystal 报表

转载 作者:行者123 更新时间:2023-11-30 13:54:07 24 4
gpt4 key购买 nike

我是 Windows 窗体应用程序的新手。这是我在办公室的第一份申请。我的办公室管理人员给了我源代码。但他们对此一无所知。

我在 visual studio 12(64 位)上运行这些代码。一切都在运行,但 Crystal 报表不工作。抛出错误。

错误是:

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)).

这是屏幕截图:

enter image description here

代码如下:

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 时,我的项目在运行时出现了同样的异常。

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

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

关于c# - Windows 窗体应用程序错误与 Crystal 报表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46556393/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com