Symptom
- Report fails to refresh.
- Unable to refresh a report based off a Universe (UNV)
- In Crystal Reports, when refreshing a report based off a Universe that uses Universe @Variable, it fails with an error like:
"Failed to retrieve data from the database...
Encountered the symbol "UNVNAME" when expecting one of the following..."
Environment
- SAP Crystal Reports 2013
- SAP Crystal Reports 2016
- SAP Crystal Reports 2020
Reproducing the Issue
- In Crystal Reports, create a report based off a Universe (UNV)
- In the Universe Designer, update the Universe connection parameter: ConnectInit
and add the following: - BEGIN DBMS_SESSION.SET_IDENTIFIER('@Variable('BOUSER')');
- DBMS_APPLICATION_INFO.SET_MODULE(module_name => 'BO-'||'@Variable('UNVNAME')', action_name => '@Variable('DOCNAME')');END;
- In Crystal Reports, open the report, based off the Universe, and refresh it.
- It now fails with the error: "Failed to retrieve data from the database..."
Cause
- Crystal Reports when reporting off Universe (UNV) support the variable: ‘BOUSER’ only. All other Universe variables are not supported.
- Therefore, when the SQL Query generated by the Universe involves other Universe @Variables, like @Variable('UNVNAME') and @Variable('DOCNAME'), it cannot be interpreted by Crystal Reports, and the report fails to refresh.
Resolution
- To be able to report off a Universe (UNV), ensure it does not use any of the unsupported Universe variable:
- In Crystal Reports, open the report based off the Universe, and take note of the Universe it is based off.
- In the Universe Designer Tool, import the Universe the report is using.
- Remove any of the unsupported Universe variables, like in the example provided, remove the following variables from the connection parameter ConnectInit:
@Variable('UNVNAME') and
@Variable('DOCNAME')
- Save and replublish the Universe.
- In Crystal Reports, re-open the report, and it will now refresh successfully.
Keywords
CR, UNV, @VAR , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , Problem
Product
SAP Crystal Reports 2013 ; SAP Crystal Reports 2016 ; SAP Crystal Reports 2020
SAP Knowledge Base Article - Public