cancel
Showing results for 
Search instead for 
Did you mean: 

Verify Database on Report with Parameterised Data Command

Former Member
0 Kudos

I have built a report which I want to run for four different tables in our MySQL database. It seems silly to have to create four different versions of the report for four different tables, so I tried to utilise the 'Add command' function which allowed me to enter a SELECT statement with a parameter of the table name. This works absolutely fine, however, if I change the table name parameter, I need to run the 'Verify database' function in Crystal Reports for the data to be shown correctly.

However, the front end for our users is a C# application which has been written to pass the necessary parameters to each report. However, when selecting a table name parameter other than the one used when the report was last saved, I get an InternalException - 'One or more fields could not be found in the result set. Use Verify Database to update the report.', Is there a way to run this function in code from .NET? (I have tried ReportDocument.VerifyDatabase() but this doesn't seem to be for the same purpose as the one I mentioned previously in Crystal Reports).

We are using Crystal Reports 2008 SP3, connecting to a MySQL database via ODBC. The application is coded using Visual Studio 2008/.NET 3.5 using the C# language. All of the database connectivity attributes of the report are set in the report itself, not in .NET.

Thanks for your help!

Edited by: StevenDay on Nov 22, 2011 12:29 PM

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

There are a couple of things to note here;

1) Make sure you are working with SP4:

SP4 https://smpdl.sap-ag.de/~sapidp/012002523100008782452011E/cr2008sp4.exe

SP4 MSI https://smpdl.sap-ag.de/~sapidp/012002523100008782532011E/cr2008sp4_redist.zip

SP4 MSM https://smpdl.sap-ag.de/~sapidp/012002523100008782522011E/cr2008sp4_mm.zip

2) If the tables are identical, the report should not need to verify the database - something you may want to have a closer look at. The message; "One or more fields could not be found in the result set.", is a confirmation of this. E.g.; the field the report is expecting is not being found...

3) ReportDocument.VerifyDatabase() does exactly the same thing as Verify in the designer. Additionally, if you enable Verify in the designer and save the report, then the Verify will be performed at runtime as well

4) Consider using InProc RAS APIs and ReplaceConnection. See [this|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/26165] [original link is broken] [original link is broken]; blog on how to.

- Ludek

Former Member
0 Kudos

Thanks very much for that - you actually answered my question in part 2 of your answer. The four tables are not exactly the same, but the fields used in the report are the same across all four tables. However, at the start of development I did 'SELECT * FROM...' as my select statement and never updated it once the report was 'complete'. Doing this sorted everything out.

I'll check out the other additional pieces of information you posted too for further reference (and, as to your recommendation to upgrade to SP4, I thought maybe today was a good time to install the copy of Crystal Reports 2011 we recently purchased!)

Thanks again.

Answers (0)