Consultor Eletrônico



Kbase P122620: Error "The table [Table Name] could not be found" when viewing a Crystal report created against an O
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   18/02/2009
Status: Verified

SYMPTOM(s):

Using Crystal RDC ActiveX to display a report via 4GL

Programmatically overriding the database connection used to create the report

Error occurs when loading the report and no data is returned

The table <Table Name> could not be found

Table is present in the database

Report previews correctly within Crystal Reports itself

Report was created using the Progress OpenEdge 10.1B driver

Reports created using previous versions of Progress / OpenEdge are displayed correctly

FACT(s) (Environment):

OpenEdge 10.1B
OpenEdge 10.1C
OpenEdge 10.2A
Crystal Reports
Windows

CAUSE:

OpenEdge 10.1B SQL introduced a Catalog property that reflects the actual name of the database, for example SPORTS2000. The Catalog property is not part of the standard Connection String / ConnectBufferString setting used by Crystal Reports and is therefore not normally overridden. The report therefore still point to the original database; checking QUALIFIERS(1) for each table will display the name of the database used when the report was created.

This is visible in Crystal Reports when connecting via ODBC and in the Properties of each table in the Set DataSource Location dialog. For example, when establishing the initial connection, there are now 4 levels displayed:

Pre-OpenEdge 10.1B:
ODBC DSN > SCHEMA > TABLE

OpenEdge 10.1B and later:
ODBC DSN > DATABASE NAME > SCHEMA > TABLE

FIX:

Override the Catalog name using either of the following methods:

Option #1
chReport:Database:Tables(i):Location = "<Database Name>".

Option #2
chReport:Database:Tables(i):SetTableLocation("<Database Name>","","").

Refer to solutions P55350 or P115877 for full code samples.