VB.NET中的Crystal Report转换 [英] Crystal Report Casting in VB.NET

查看:84
本文介绍了VB.NET中的Crystal Report转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我对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 declared crTable in your VB.NET code? The error indicates that you have declared it as an array when it should be declared as a CrystalDecisions.CrystalReports.Engine.Table.


如果您的arrTables 被声明为array of CrystalDecisions.CrystalReports.Engine.Table,则

crTable 被声明为CrystalDecisions.CrystalReports.Engine.Table的单个实例,

那我不明白为什么你不能不使用演员表就设置它...

If your arrTables was declared as an array of CrystalDecisions.CrystalReports.Engine.Table,

and crTable is declared as a single instance of CrystalDecisions.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屋!

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