cancel
Showing results for 
Search instead for 
Did you mean: 

[Crystal Report C# API] How to get exception thrown from Stored Procedure called from Crystal report

Former Member
0 Kudos

Hi,

I am having troubles trying to retrieve all the exception messages from C# API ReportDocument.ExportToDisk.

Under certain conditions Stored Procedure which is the source of the data for the report throws an exception (MSSQL RAISERROR). When running from Crystal Reports 2008 application several messages are popping up in the following order:

1. Failed to retrieve data from the database.

2. Failed to retrieve data from the database.

3. Database Connector Error: '42000: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server] [TEXT OF THE EXCEPTION FROM STORED PROCEDURE]'

But when running form C# API by calling ReportDocument.ExportToDisk exception is thrown only for the first message (Failed to retrieve data from the database.) and execution stops. Inner exception of this exception does not contain any additional information.

What I need is to get the text of the message from Stored Procedure which is the 3rd message when running from Crystal Report 2008 application.

Crystal Runtime 12.7.3.2302.(2008)

Windows 10

.Net 4.7

MS SQL

Any advise on the topic is really appreciated.

Thank you.

View Entire Topic
0 Kudos