1862890 - Error: "Failed to retrieve data from the database" when refreshing a report based off a Universe in Crystal Reports

SAP Knowledge Base Article - Public

1862890 - Error: "Failed to retrieve data from the database" when refreshing a report based off a Universe in Crystal Reports

Symptom

  • Report fails to refresh.
  • Unable to refresh a report based off a Universe.
  • 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..."
       

    ORA-Error.png 

Environment

  • SAP Crystal Reports 2008
  • SAP Crystal Reports 2011
  • SAP Crystal Reports 2013
  • SAP Crystal Reports 2016

Reproducing the Issue

  1. In Crystal Reports, create a report based off a Universe.
               
  2. 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;
          
  3. In Crystal Reports, open the report, based off the Universe, and refresh it.
        
  4. It now fails with the  error: "Failed to retrieve data from the database..."

Cause

  • Crystal Reports when reporting off Universe 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.
                
  • For further information on what is supported in Crystal Reports when reporting off a Universe, see the document: Crystal Reports Universe Support

Resolution

  • To be able to report off a Universe, ensure it does not use any of the unsupported Universe variable:
          
    1. In Crystal Reports, open the report based off the Universe, and take note of the Universe it is based off.
        
    2. In the Universe Designer Tool, import the Universe the report is using.
          
    3. 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')
         
    4. Save and replublish the Universe.
          
    5. 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 BusinessViews Manager , Problem

Product

Crystal Reports 2008 V1 ; SAP Crystal Reports 2011 ; SAP Crystal Reports 2013 ; SAP Crystal Reports 2016

Attachments

Universe based CR whats supported (2).pdf