VB.NET中的Crystal Report转换 [英] Crystal Report Casting in VB.NET
问题描述
大家好,
我对VB.NET中的Crystal Report有点困惑.
当我在C#.NET中使用以下代码时,没有问题:
Hi Everybody,
I have a little bit confusion about Crystal Report in VB.NET.
when i use the following code in C#.NET,there is no Problem:
crTable = (CrystalDecisions.CrystalReports.Engine.Table)arrTables[0];
但是,我更改为VB.NET.问题开始了
我的vb代码在那里:
Nevertheless, I change to VB.NET.the problem starts
my vb code is there:
crTable = DirectCast(arrTables(0), CrystalDecisions.CrystalReports.Engine.Table)
显影时间出错.
错误消息:"value of type''CrystalDecisions.CrystalReports.Engine.Table'' cannot be converted to ''1-dimensional array of CrystalDecisions.CrystalReports.Engine.Table''."
这段代码有什么问题.请指导我. :confused:
There is error in developing time.
error message: "value of type''CrystalDecisions.CrystalReports.Engine.Table'' cannot be converted to ''1-dimensional array of CrystalDecisions.CrystalReports.Engine.Table''."
What wrong with this code. please, guide me. :confused:
推荐答案
如何在VB.NET代码中声明crTable
?该错误表明您应在将其声明为CrystalDecisions.CrystalReports.Engine.Table
时将其声明为数组.
How have you declaredcrTable
in your VB.NET code? The error indicates that you have declared it as an array when it should be declared as aCrystalDecisions.CrystalReports.Engine.Table
.
如果您的arrTables
被声明为array of CrystalDecisions.CrystalReports.Engine.Table
,则
和crTable
被声明为CrystalDecisions.CrystalReports.Engine.Table
的单个实例,
那我不明白为什么你不能不使用演员表就设置它...
If yourarrTables
was declared as anarray of CrystalDecisions.CrystalReports.Engine.Table
,
andcrTable
is declared as a single instance ofCrystalDecisions.CrystalReports.Engine.Table
,
then I don''t see why you couldn''t just set it without the cast...
crTable = arrTables(0)
这篇关于VB.NET中的Crystal Report转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!