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
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!)