gpretorius
asked on
Changed to strongly typed dataset not reflected in Crystal Reports
I use Visual Studio .NET 2003 (C#) with embedded Crystal Reports.
I added a report to my solution which I based on a strongly typed dataset in the same solution. After some initial work on the report, I added a field to the dataset. However, I can not get Crystal Reports to refresh the field list - I have used the Verify Database option and this simply indicates that the database is up to date. I have also switched on the "Discard data..." option.
The report works fine when passed the new dataset but I can not access the additional fields in the designer. I have previously had this problem in another project and it resolved itself at some stage.
I added a report to my solution which I based on a strongly typed dataset in the same solution. After some initial work on the report, I added a field to the dataset. However, I can not get Crystal Reports to refresh the field list - I have used the Verify Database option and this simply indicates that the database is up to date. I have also switched on the "Discard data..." option.
The report works fine when passed the new dataset but I can not access the additional fields in the designer. I have previously had this problem in another project and it resolved itself at some stage.
ASKER
I have tried your suggestion above already. The dataset is set to generate.
I have tried replacing the data source as you indicate and it makes no difference.
I have tried replacing the data source as you indicate and it makes no difference.
You sometimes need close the project, re-open it, re-build it and only then you are able to set the location.
ASKER
I have tried:
Re-building everything
Closing everything down
Restarting my machine
Re-building everything
Closing everything down
Restarting my machine
Are you sure that your xsd file is modified?
ASKER
Yes. I have viewed the xsd file and it has the changes in it. The additional fields are being populated and passed to the report at runtime.
I had hard time with that in the past (more when I was using VS.Net 2002). I have ever been able to finally have my fields and some times after using the "Set Location" feature many time!
Sorry, I can't do much without having your problem on my PC!
Sorry, I can't do much without having your problem on my PC!
You need to refresh the database. Open the crystal reports editor and check the menus. Search for an option Verify database or something like this. You can try to right click outside the report, select Database->Verify database
Sorry for the inaccurate explanations but I have no installation in front of me. However I am sure this works (at least in most cases, don't forget it's Crystal....)
Sorry for the inaccurate explanations but I have no installation in front of me. However I am sure this works (at least in most cases, don't forget it's Crystal....)
ASKER
> select Database->Verify database
I have tried that already and it doesn't work
I have tried that already and it doesn't work
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
btw, you will have to toggle the "view all files" setting to see the .cs file.
ASKER
When I logged in today and did a Verify Database I was suddenly told that the database has been updated.
I then made a further change to the dataset which was not picked up, but deleting the .cs file, shutting down VS and on restart doing a Verify Database seems to have done the trick.
I then made a further change to the dataset which was not picked up, but deleting the .cs file, shutting down VS and on restart doing a Verify Database seems to have done the trick.
This is one of the most frustrating issues in Crystal .Net. So much of Crystal just doesn't work properly or as expected.
The real solution is to "Log Off" the dataset using the "Database->Log On/Off Server..." dialog, then run the database verify.
No need to delete code behind files, run the custom tools, relaunch VS, or reboot.
It seems that Crystal caches the dataset schema and the verify tool only verifies against the cache, not the actual database. The Log Off feature ensures that the cache is cleared before a verify attempt, forcing the verify against the actual dataset.
The real solution is to "Log Off" the dataset using the "Database->Log On/Off Server..." dialog, then run the database verify.
No need to delete code behind files, run the custom tools, relaunch VS, or reboot.
It seems that Crystal caches the dataset schema and the verify tool only verifies against the cache, not the actual database. The Log Off feature ensures that the cache is cleared before a verify attempt, forcing the verify against the actual dataset.
-open your xsd
-be sure that "generate dataset" is checked under the schema menu
-You may need to save at this point
You need to re - "Set the location"
-Open your report
-right-click anywhere outside the report (in the grey zone)
-Select database
-select Set Location
-In the "Replace with" list, open the "Project Data" node and the the "ADO.Net Datasets" node and find your schema there click on it and click the Replace button
-now you can "Verify the database"