开发者

Crystal Report VerifyDatabase not working

I have a Crystal Report that was designed against a dev database. When I load it into the live system I need it to run a different but equivalent database. Normally I just run reports through some code in C# that sets the connection info, parameters and calls VerifyDatabase on the report and subreports and it all works well.

In one particular report this doesn't work though and 开发者_如何学编程doesn't seem to verify anything and the report crashes with an error 'The field name is not known' in one of the sub reports. With this report if I manually verify it in the Crystal Reports application against the live database then it all works fine.

So the question is, is there anything different that Verify Database function in the Crystal application does that I should do in code other than set connection info, parameters and call VerifyDatabase method?

Edit: Some more info on what I tried

  1. Get a backup of the live database and put it on our dev environment.
  2. Manually verify the report against this database (which is exactly the same structure as live)
  3. Load the report into the live system and run it.

Error still occurs.


The 'field name is not known' error usually means that you have placed a field on the report or used it in a formula (etc), but the field no longer exists in the database. As I understand it, calling VerifyDatabase can update the field list for the views/tables in the report, and can remove fields from the report if they no longer exist, but it cannot fix formulas or subreport links which depend on a missing field.

It seems to me a better practice to make sure that the database is in sync (verified) before deploying the report so you don't need to call VerifyDatabase every time.

All that said, I don't see why it would work after manually verifying, but not after calling VerifyDatabase. Sometimes Crystal is weird that way. You might try recreating the subreport (if it is simple), or removing it and rebinding it to try to trick the error into going away.


It sounds like a confusion between two versions of Crystal and their capabilities. The version that comes with dotNET 2008 is Crystal Reports Basic for VS2008, masquerading as Crystal 10.5 (which doesn't exist as a standalone product). But if you're referring to standalone reports developed by themselves outside of the Visual Studio IDE, then this will be a different version of Crystal with some differences in capability. I'd say this report was created in a different version of Crystal to the others, and that the Verify within the code is coming across some feature that 10.5 can't recognise. If you have a standalone version of Crystal (which will need to be either Crystal Reports 2008, or a Developer edition of an earlier version), use this to make sure you're using the same Crystal version in the app as in in report development.


Could you verify this:

While the debugger is running, if the schema in a typed dataset is changed and you run Verify Database the messagebox always displays "Database up to date" even though there is a difference in the two schemas.

This took me a while to figure out because the Verify Database action was not disabled when the debugger was active.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜