需要帮助VB.NET中的某些代码 [英] Need help for a certain code in VB.NET
本文介绍了需要帮助VB.NET中的某些代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我不知道为什么我的代码出错了。
Dim objRpt As 新 CrystalReport1
我需要导入什么?或者我是否必须做一些特殊的操作才能删除错误?
错误说明,CrystalReport1未定义。我不知道该怎么办。
谢谢!
我试过的:
我还没有真正尝试过任何东西,因为我不知道该怎么办。
解决方案
正如错误消息所述,在Crystal Report库中没有名为CrystalReport1
的类。查看您拥有的变量名称,您是否正在尝试创建ReportDocument类的新实例。
要开始使用,请查看示例如何在VB.NET中加载和显示Crystal Reports [ ^ ]。这篇文章很旧但很多细节仍然有效。
错误非常明确: CrystalReport1未定义
这意味着没有定义名为CrystalReport1
的类,可能是因为它是您添加到表单中的CrystalReports实例。 br />
尝试直接使用CrystalReport1
而不是objRpt
来访问您添加的实例。
I don't know why I get an error on this code.
Dim objRpt As New CrystalReport1
What do I have to import? Or do I have to do anything special to remove the error?
The error says, CrystalReport1 is not defined. I don't know what to do.
Thanks!
What I have tried:
I haven't really tried anything because I don't know what to do with it.
解决方案
Exactly as the error message said, in the Crystal Report library there is no class namedCrystalReport1
. Looking at the variable name you have, are you trying to create a new instance of a ReportDocument class.
To get started, have a look at for example How to Load and Display Crystal Reports in VB.NET[^]. The article is old but many of the details are still valid.
The error is pretty clear: "CrystalReport1 is not defined"
What it means is that there is no class defined calledCrystalReport1
, probably because it is an instance of CrystalReports that you added to your form.
Try usingCrystalReport1
directly instead ofobjRpt
to access the instance you added.
这篇关于需要帮助VB.NET中的某些代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文