Author |
Message |
Hugo
Newbie
Joined: 05 Aug 2010
Location: Canada
Online Status: Offline
Posts: 8
|
Topic: Crystal Report 2005 DataSource Posted: 23 Mar 2011 at 9:57am |
Hi! I'm having a problem with my report, build with Visual Studio 2005 with is version 10, if I remember well. To build my report I've first save a DataTable to a XML file, then bind that XML file to a new Report, has a Report schema, to help me building it. At RunTime, I'm setting the report DataSource to a new DataTable witch have the same schema (same SQL Query) has the one used to build the report and using the command MyReport.SetDataSource(MyDataTable) Everything goes well, until I remove the XML file that I use to build the report. When I call the VerifyDatabase, after setting SetDataSource, crystal thrown a exception "Log On failed" and sometime thrown a exception "Invalid mapping type value". I'm really stock with that one, I've recreate my report from scratch without success. Need help Hugo
|
IP Logged |
|
lockwelle
Moderator
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
|
Posted: 24 Mar 2011 at 3:38am |
have you tried not verifying the database? I have created many reports using the method you describe, but I have never removed the file and aske to verify the database.
Look at it from CR's point of view. The only schema that it knows for how the data should look is located in that file. If it is gone, it has nothing to look at to see if the data it has matches what it should have. It has no reference to see if the fields in the report match the datasource.
You can create the report and deploy it and use, you just can't verify the database without the file. If you decided to change the schema of the report, say by adding or removing a field, you would bring out a new XML file. Let say you forgot the name of the original file, and you saved the new schema as a different file in a different place. You could verify database until the cows come home, and the report would never see the change. Once you went into Database Expert and changed the file that the report is looking for, only then will you see the changes in your schema.
In short, you're not doing anything incorrect, until you try to verify the database without the database(XML file) to verify against.
HTH
|
IP Logged |
|
Hugo
Newbie
Joined: 05 Aug 2010
Location: Canada
Online Status: Offline
Posts: 8
|
Posted: 25 Mar 2011 at 2:43am |
Thanks for your reply, Well your point of view is not bad, but many other report that I've made are working OK with my method. But no this one.
I've try not to do the VerifyDatabase, but the error raise anyway a little further in my code.
What do you suggest for me to use as a Report data Schema? Typed Dataset? something else?
|
IP Logged |
|
lockwelle
Moderator
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
|
Posted: 25 Mar 2011 at 4:05am |
the XML file with schema is a typed dataset.
I guess where I am confused is, why do you need to Verify Database? The only time I do that is when I change the schema, which is rare. Otherwise, I just set the DataSource to the DataSet that my application has retrieved via the stored proc.
As long as the schema doesn't change, I never bother to verify the database. lately, when I have had to do this, I usually need to recreate the XML file as the 'original' is lost
The other part that confuses me, and you as well, is what is different about this report, since others you have written in this manner work fine. I guess, put another way, what is different about this report?
HTH
|
IP Logged |
|
Hugo
Newbie
Joined: 05 Aug 2010
Location: Canada
Online Status: Offline
Posts: 8
|
Posted: 25 Mar 2011 at 4:24am |
Well I was talking about Typed Dataset as a .NET Typed Dataset, witch take part of the DLL/Exe. But yes XML is a Type DataSet. You are right, I need to find what is the difference between my reports, I need to dig down this, but I've the feeling that I'll never find what is the difference. I was hoping to find some help around but I realize that this problem is to much pointy/sharp for an Outsider to help. I wish that telling you my opinion on Crystal would help me ...
|
IP Logged |
|
Hugo
Newbie
Joined: 05 Aug 2010
Location: Canada
Online Status: Offline
Posts: 8
|
Posted: 25 Mar 2011 at 5:19am |
When I skip the VerifyDatabase, when the report open in the Report Preview, the Report ask me a SQL Login (User/Password) But that report never had a Link to a Database.
|
IP Logged |
|
lockwelle
Moderator
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
|
Posted: 28 Mar 2011 at 3:00am |
you got me... I am assuming that the report was set up with an ADO.NET connection.
I've never had that happen to me, so I have no idea as to the remedy
|
IP Logged |
|
Hugo
Newbie
Joined: 05 Aug 2010
Location: Canada
Online Status: Offline
Posts: 8
|
Posted: 28 Mar 2011 at 9:45am |
Finally ... founded what cause the error.
the DataSet that a was seting to the report with "SetDataSource" command, was having a different name then the expected one.
In other term, for exemple Crystal Was expecting a table with the name 'MyTable001' and the DataSet that he receive was "dsMyReport".
...
|
IP Logged |
|
Keikoku
Senior Member
Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
|
Posted: 28 Mar 2011 at 10:14am |
Small bugs are great. Glad you found the problem.
|
IP Logged |
|
|