Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > Crystal Reports
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Crystal Reports General discussion about Crystal Reports. For discussions specific to the book Professional Crystal Reports for VS.NET, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Crystal Reports section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 15th, 2006, 04:38 PM
Registered User
 
Join Date: Feb 2006
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default "Invalid object format name" Error

Hi there,

I am trying to upgrade a crystal application from VS.Net 2003 to VS.Net 2005. Some of the reports work just fine in the new enviroment. But one of the reports does give me a hard time.

It is a little complicated, so please bare with me. The report uses a c# derived DataSet class as its Database Fields source. It also uses a DataTable as its data source. When I try to bind the report with the data source, for example, myReport.setDataSource(myDataTable);. It throws the following exception:

CrystalDecisions.CrystalReports.Engine.InternalExc eption was unhandled by user code
Message="\rError in File C:\\WINDOWS\\TEMP\\temp_c2eb4661-c3c0-429a-9d9f-c0b280e112bc {645E2563-B9C6-4A6F-9714-618DF7CB1EE2}.rpt:\nInvalid object format name."
Source="CrystalDecisions.ReportAppServer.DataSetCo nversion"
StackTrace:
at CrystalDecisions.ReportAppServer.ConvertDotNetToEr om.ThrowDotNetException(Exception e)
at CrystalDecisions.CrystalReports.Engine.ReportDocum ent.SetDataSourceInternal(Object val, Type type)
at CrystalDecisions.CrystalReports.Engine.ReportDocum ent.SetDataSource(DataTable dataTable)
at NL2.Web.GlRptFsWModule.getReport(Boolean sendToPrinter, exportTo eExport) in c:\Inetpub\wwwroot\NL2\Web\reports\GlRptFsWModule. ascx.cs:line 900
at NL2.Web.GlRptFsWModule.cViewButton_Click(Object sender, EventArgs e) in c:\Inetpub\wwwroot\NL2\Web\reports\GlRptFsWModule. ascx.cs:line 1246
at System.Web.UI.WebControls.LinkButton.OnClick(Event Args e)
at System.Web.UI.WebControls.LinkButton.RaisePostBack Event(String eventArgument)
at System.Web.UI.WebControls.LinkButton.System.Web.UI .IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

I traced the program and realized that once I change the format of the FieldObject and call the report object's refresh() method, the same exception is thrown. For example:

myReport.Refresh(); // ok here
myFiledObject.Width = 0;
myReport.Refresh(); // throw exception

I also tried to reset all the FieldFormat for the FieldObject, but the same thing happen. Once I change the FieldFormat and refresh, it throws an exception. I am so confused now!

myReport.Refresh(); // ok here
myFiledObject.FieldFormat.BooleanFormat.OutputType = BooleanOutputType.TrueOrFalse;
myReport.Refresh(); // throw exception



Can any crystal report expert/genius give me some hints on what did I do wrong or what could be the problem? Thanks in Advance!


Reply With Quote
  #2 (permalink)  
Old September 20th, 2006, 03:04 PM
Registered User
 
Join Date: Sep 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

When you write a Strongly-Typed DataSet in .Net, the default format is String. When you bind your DataSet to the Crystal Report, it also binds it's format... so when you programmatically pass your dataset to your report by using SetDataSource(), be sure that all your fields in your dataset returned from the database are in the string format (by explicitly using CAST ( [NumericField] AS VARCHAR(precision) ) in your stored procedure. If you need to keep the numeric format (datetime, or anything else...).

This is why it says "Invalid [u]object format</u> name." :)

WebMasterSam

Reply With Quote
  #3 (permalink)  
Old September 27th, 2006, 04:42 AM
Registered User
 
Join Date: Sep 2006
Location: , , Australia.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

you will not believe it, but it worked with me. no matter your strongly-typed dataset fields' data types.
use empty formulas in your crystal report. at runtime adjust the format for any fieldobject, at the end set the formula("formula-name").text = "formula expression"
you can do this for each formula and all formulas in concern then at the end bind your report to your data source as you do now. and then every thing will work.
the whole idea is to change the order of your statments, set the formula expression the last thing after changing all its other properties.
pls let me know if it worked with you.

Princess
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
invalid object dbo.split error............ hepsy.i ASP.NET 1.0 and 1.1 Professional 1 August 8th, 2007 06:31 PM
Error Old Format or invalid type Libraiy bahraman VB.NET 2002/2003 Basics 0 July 17th, 2006 08:05 AM
Error Old Format or invalid type Libraiy bahraman VB.NET 2002/2003 Basics 0 July 17th, 2006 08:02 AM
Error message: old format or invalid type library kaz .NET Framework 2.0 2 October 6th, 2004 12:39 PM
Error: Invalid PInvoke metadata format shahchi1 General .NET 1 May 26th, 2004 08:16 AM



All times are GMT -4. The time now is 12:37 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.