When an error occurs during generation a report, the error message doesn't say much:

Failed to retrieve data from the database.
Details: [Database Vendor Code: 295 ]

How to retrive the error message? You have to select from sysmessages table in Sql Server database. In this example:

SELECT * FROM master.dbo.sysmessages WHERE error = 295

The query gives the error description: