Print Page | Close Window

Crystal Report Viewer

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Data Connectivity
Forum Discription: How to connect to data sources and export reports
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=1033
Printed Date: 05 May 2024 at 8:22am


Topic: Crystal Report Viewer
Posted By: Tanya51
Subject: Crystal Report Viewer
Date Posted: 19 Jul 2007 at 9:12am
Confused  When I try to run my report I get an error message "cast from type crystal report viewer to type string is not valid.  Can anyone tell me how to correct this error.



Replies:
Posted By: BrianBischof
Date Posted: 19 Jul 2007 at 11:55am
I haven't seen this error, so I don't know if I can help. But if you could post some code then that would help. I think you just have some variable declarations being confused and you're trying to assign a viewer object to a string variable. You should let the mouse hover over the variables and see what their variable declaration is.

-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>


Posted By: Tanya51
Date Posted: 20 Jul 2007 at 6:06am
Brian,  thank you for getting back to me.  As it turns out I had some connection code in the wrong area of the form, when I moved it the error went away.  Being new to programming it's hard to know where to place code sometimes.  I 've never had to do a crystal report until now, so  I purchased a copy of your book for guidance, so hopefully I will be able to complete my report.  Thanks again for your willingness to help me.  I may need assistance at some point, but for now I think I'm ok.
 
Tanya


Posted By: BrianBischof
Date Posted: 20 Jul 2007 at 8:08am
Glad to hear that it works. The only problem with my book was that it was written for .NET 2003. The biggest changes for 2005 are that ASP.NET doesn't allow embedded reports within a project. Thus, if you want to load a report with ASP.NET then you have to use the Load() method of the ReportObject class. The rest of the book should be about 90%+ accurate. I'll have the .NET 2005 book out at the end of this year.

-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>



Print Page | Close Window