Disclaimer: Boyum It does not provide free support for modifying Crystal Layouts or help with layout issues on layouts that are not created by us. If you modify our default layouts and encounter issues this is also considered premium support.
I get the error "Failed to retrieve data from the database"
The first step is figuring out what error code Crystal returns. Normally when you get this error you will also see the text [Database Vendor Code: xx]. Where xx is a number. The number is the raw error code returned by the database (see http://scn.sap.com/thread/1811789).
Let's say you have the error code 156 ([Database Vendor Code: 156]) you can look this up on TechNet (https://technet.microsoft.com/en-us/library/aa258712).
156 is due to: "This error indicates that the syntax of a Transact-SQL statement is incorrect and that the syntax error was detected near the keyword specified in the error message.".
To find the SQL that gives the error you can use the SQL Server Profiler to find an identify the issue http://blogs.msdn.com/b/jenss/archive/2009/09/25/cannot-find-the-source-of-a-sql-server-error.aspx