473,403 Members | 2,293 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

"Specified cast is not valid" error in Crystal Reports 9.0 Develop

I posted this question on the Crystal Reports Support site and I am still
waiting for an answer.
Using Crystal Reports 9.0 Developer Full edition:

My Crystal report .RPT file has a Picture box which is an OLE Object located
in the Page Header section of my .RPT file.
This is the call which works perfectly in VB6 to format the crystal reports
Page Header section of my report file EquipLst.rpt.
This format procedure causes a Logo file to be loaded into the Picture box
in the Page Header section of the report using the VB Load picture method.
Private Sub crSectionPH_format(ByVal pFormattingInfo As Object)

' check each object in the Page Header section
For Each crObject In crSectionPH.ReportObjects
' we are only considering if it is an OLE object
Select Case crObject.Kind
Case craxdrt.CRObjectKind.crOleObject:
Dim crxPicture As craxdrt.OLEObject
Set crxPicture = crObject
pix = RO_CompanyInfoDS("Company_Logo")
Set crxPicture.FormattedPicture = LoadPicture(pix)
Exit Sub
End Select

Next crObject
End Sub
After UPGRADE to Visual Studio 2003 .NET the code is:
Private Sub crSectionPH_format(ByVal pFormattingInfo As Object) Handles
crSectionPH.format

' check each object in the section
Dim crxPicture As CRAXDRT.OleObject
For Each crObject In crSectionPH.ReportObjects
' we are only considering if it is an OLE object
'UPGRADE_WARNING: Couldn't resolve default property of object
crObject.Kind. Click for more:
'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1037"'
Select Case crObject.Kind
Case CRAXDRT.CRObjectKind.crOleObject
crxPicture = crObject
pix = RO_CompanyInfoDS.Fields("Company_Logo").Value
'--------------------------------------------
crxPicture.FormattedPicture = System.Drawing.Image.FromFile(pix)
'Indicates that "Specified cast is not valid"
'--------------------------------------------
Exit Sub
End Select

Next crObject
End Sub
After looping through the objects in the page header of my Crystal Reports
Form, and finding an crOleObject of Type Picture,

and reading the path of the Bitmap picture from:

RO_CompanyInfoDS.Fields("Company_Logo").Value
and assigning it to the GLOBAL string pix,

the next line:
crxPicture.FormattedPicture = System.Drawing.Image.FromFile(pix)

'Indicates that "Specified cast is not valid"

After upgrade from vb6 I get this error. If any crystal report experts are
reading this problem... How can I fix this?

Thanking you in advance.

Jul 21 '05 #1
1 5801
Hi,

Currently the Crystal Report is not supported by Microsoft. Here is a KB
article which provides information on the licensing and support on Crystal
Report.

http://support.microsoft.com/?id=317789

We can also wait here to see if any community member has some idea on this.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Özden Irmak | last post by:
Hello, In my application, I've to cast DocumentDesigner class to my own derived class,MyDocumentDesigner, in order to reach the protected properties in DocumentDesigner class. But everytime I...
0
by: Peter Afonin | last post by:
Hello: When I try to access a SQL server or a network share from an ASP.Net application that I run on my computer, I run into security problems (for instance, I cannot execute DTS package using...
8
by: Charles | last post by:
I do not understand why I am getting a "Specified cast is not valid" error, since it has worked before. Something has changed and I am not really sure what it could be. I am looking for something...
4
by: Mike Cooper | last post by:
There is something about inherited classes I evidently don't know... I wrote the following class: Class Class1 inherits System.Windows.Forms.DataGridTextBoxColumn End Class There is...
10
by: roy.anderson | last post by:
Error is thus: "Cast from type 'DBNull' to type 'String' is not valid." Simple, right? Well, no (or at least not for me). Here's a function, followed by the calling code below: Function...
3
by: Jayyde | last post by:
Not sure why all of a sudden this line of code: cmbProductCategoryTreeDisplayName.SelectedIndex = 0; is producing a "Specified cast is not valid error". In the watch it has 1 item in it at...
3
by: keithb | last post by:
Using a GridView, I get a "Specified cast is not valid" error when binding the Visible propery of a hyperlink control to a DataTable text field. The error goes away if I replace the data binding...
12
by: Pao | last post by:
Hi all For all NEW sites (virtual directories) that I create, I receive always the same error: (I translate so may be a little different) Impossible to visualize the XML page Impossible to...
0
by: Curious | last post by:
Hi, I'm not sure if this is the right place to post such command issues. If you know a better forum where people respond to messages fairly often, please let me know! Anyway, would appreciate...
3
by: =?Utf-8?B?UGF1bCBQcmV3ZXR0?= | last post by:
I'm attempting to use LINQ to insert a record into a child table and I'm receiving a "Specified cast is not valid" error that has something to do w/ the keys involved. The stack trace is: ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.