Click here to Skip to main content
16,021,004 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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:
C#
crTable = (CrystalDecisions.CrystalReports.Engine.Table)arrTables[0];


Nevertheless, I change to VB.NET.the problem starts
my vb code is there:
crTable = DirectCast(arrTables(0), CrystalDecisions.CrystalReports.Engine.Table)


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:
Posted
Updated 13-Feb-11 16:55pm
v2

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.
 
Share this answer
 
v2
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)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900