3119479 - How to Resolve the Database Login Error Occurs When We Try to Print/Preview a Document With the Crystal Reports Layout
How to resolve the Database Login error occurs when we try to print/preview a document with the Crystal Reports layout.
Reproducing the Issue
When you try to print/preview a document with the Crystal Reports layout, you find that the Database Login window appears.
When you enter the Login ID and Password, you find that the following error message is displayed:
"Failed to login to database" or "Logon Failed. Please try again".
If you choose the Cancel option, you find that the system hangs or crashes after a while.
Scenario 1: Application Error
There are some application errors which may cause this issue, follow the below mentioned SAP Notes to resolve it:
Scenario 2: Environment Setup
- The issue occurs in some workstations but not in others. In affected workstations, you find that the issue occurs for all Crystal Report layouts, including the system ones.
- Make sure that you are using supported version of Crystal Report for SAP Business One, check SAP Note 2329487 - Crystal Reports for SAP Business One Matrix for supported Crystal Report version.
Download different versions of Crystal Reports for SAP Business One from the SAP Software Download Center: https://launchpad.support.sap.com/#/softwarecenter → SAP Business One → SAP Business One Products → SAP CRYSTAL REPORTS FOR B1.
- The issue might be related to the Integrated Securitysetting in the customer environment.
Clear all the data for the login in the Database Login window (for example, delete the sa and password) and select Integrated Security.
If the Integrated Security does not work in the customer environment, change your OLE DB connection as follows:
In the CR Designer navigate to Database → Set Datasource Location and expand the Properties for the current connection. Edit the following properties:
- Integrated Security: False
- UserID: sa
Scenario 3: Corrupted Layout Connection
- The issue occurs on specific Crystal Reports layouts, but works properly on other layouts.
- The issue may occur after upgrading.
- Check the current datasource.
- In the Crystal Designer choose Database → Set Database Location.
- Under each data source, open the Properties in order to see whether they are correct.
- If you find that some of the connections are incorrect in the Replace with window, choose the corresponding table with the correct connection and choose the Update button.
- Save the layout.
- Verify the database connection.
- In the Crystal Designer choose Database → Database Expert, rename the connection and choose the OK button.