Additional Blogs by SAP
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
0 Kudos
SAP BUSINESS ONE
KEY RESOURCES FOR CROSS TOPICS RELATED SUPPORT ISSUES
 
 
"Fail to Retrieve Data from the Database" when printing with Crystal Reports
RCA

"Fail to retrieve data from the database" is a common error user might come across when working with Crystal Report. The exact error message might differ in different scenarios.

In this blog we will investigate the root cause of the error message "Fail to Retrieve Data from the Database" when print/ Preview with Crystal Report.

Hope this could help the user in trouble shooting.

IMPORTANT!
  1. Run all attached queries on query analyzer and not via application.
  2. For further information please refer to the attached notes.
  3. Please contact support center with any DB inconsistencies you may find.
Crystal Report Error: Fail to Retrieve Data from the Database
  1. Influence 1: Environment Setup
  2. Influence 2: User Error
  3. Influence 3: System Behavior
  4. Appendix 1: Application Error
[] Influence 1: Environment Setup
Symptom:
When preview/ print with any Crystal Reports/ Layouts (including system crystal layout) on all databases (including Demo database) from all workstations linked to a server, you come across the following error message:


What to do\check?
  1. If this issue happened on win7, please make sure the User Account Control (UAC) is disabled or you run this case with Run as administrator option.
  2. Make sure the versions of components are compatible, such as versions of CR Runtime/Designer, DI API, SBO-COMMON, Company DB.
  3. Make sure the %temp% folder is cleaned.
  4. If the issue persists after the above steps, test to upgrade to the latest B1 release.

[] Influence 2: User Error
Symptom:
When preview/ print with a specific user defined Crystal layout/ Report, you come across the following error message:


What to do\check?
  1. Go to Crystal Report designer menu, Database > Set Datasource Location..., ensure the database name, table name, user name and password are correct.
  2. Check in SQL management studio, ensure that the fields, tables and procedures used by the Crystal Report exist and that SQL Queries can be executed against them.
  3. Go to Crystal Report designer menu, Database > Show SQL query, ensure the query does not contain any syntax error.
  4. If the query shown is valid, please try to run it in the SQL management Studio.
Reference:
Note 1398036 - Failed to retrieve data from the database

[] Influence 3: System Behavior
Symptom:
When preview/ print user Crystal Layouts you receive the error message:

Error in database connector.
Failed to retrieve data from the database

Additional:
  1. The user Crystal Layouts contains UDF with (*SIZE*) type.
  2. The issue happens on all workstations.
  3. The Crystal Layout is using 'SAP Business One' connection.
  4. The issue happens on SQL 2005.
What to do\check?
It is a system behavior that when the database type is MS SQL 2005, if you create an alphanumeric UDF with certain size, in database the column is set to nvarchar(max), not nvarchar(*SIZE*).

Resolution
Workaround is to create a key on it to convert it back from nvarchar(max) to nvarchar(*SIZE*).

Reference
Note 1226534 - Sized Alphanumeric UDF is set to nvarchar(max) in SQL 2005

[] Influence 4: Application Error

[] Case 1
Case 1:
Symptom:
When running system crystal report Sales reports -> Jahresumsatzanalyse (Nach quartal)/ Annual Sales Analysis (by Quarter), you come across the following error message:


What to do\check?
  1. Note 1579707 - Annual Sales Analysis (by Quarter) - Failed to retrieve data from the database
  2. Note 1522137 - Error message when running Jahresumsatzanalyse (Nach quartal)

[] Case 2
Case 2:
Symptom:
When preview/ print user Crystal Layouts you receive the error message:

Error in database connector.
Failed to retrieve data from the database

Additional:
  1. The user Crystal Layouts contains UDF.
  2. The issue happens on all workstations.
  3. The Crystal Layout is using 'SAP Business One' connection.
What to do\check?
Workaround is to use OLE DB connection.

Resolution:
Note 1611156 - UDF Values not Printed in Crystal Layout
Please update us with any additional cases /scenario/ information you have encountered !