cancel
Showing results for 
Search instead for 
Did you mean: 

PL/SQL Stored Procedure custom exceptions not being passed to C# from CRXI report using Oracle 11g.

Former Member
0 Kudos

I am using C# to export a CRXI report to pdf and whenever the stored procedure being called by the report throws a custom exception the only exception I see in C# is "Failed to retrieve data from the database". In the Report Designer, I see this message, then the more detailed message, but in C# I only see the first message. I am using VS 2005, CR XI, Oracle 11g, and the DataDirect 5.3 ODBC Wire Protocol drivers. Any help would be appreciated. Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

My first recommendation would be to go to CR XI R2A (11.5 - SP6). See this blog on how to.

- Ludek

Follow us on Twitter

Got Enhancement ideas? Try the SAP Idea Place

Share Your Knowledge in SCN Topic Spaces

Answers (1)

Answers (1)

0 Kudos

Hi James,

Try upgrading to XI R2 first, it's free, use your XI keycode to install and then call Customer Services to get a XI R2 keycode to use for distribution.

http://downloads.businessobjects.com/akdlm/crystalreports/crxir2_sp4_full_bld_0-20008684.exe
http://downloads.businessobjects.com/akdlm/crystalreports/CRYSTALREPORTS06_0-20008684.EXE

See if using a try/catch and the exception to see if it gets more info:

        catch (Exception ex)
        {
            MessageBox.Show("ERROR: " + ex.Message);
            return;
        }

If that doesn't work then you'll have to ping the DB Server to get the info.

Don

Former Member
0 Kudos

I think we are already on XI R2. I updated everything so now the version of the CrystalDecisions.CrystalReports.Engine.dll in our target machine is 11.5.9508.939. Is that the most current? It does not seem to have made a difference. Still no detailed error messages.

Former Member
0 Kudos

When I run this report in the designer, I get prompted twice when there is an error. First with the "Failed to retrieve data from the database" message, then with the actual pl/sql error. Is there any way to access this second error in C#?

0 Kudos

Hi James,

Yes you are up to date...

That second message is being passed to CR from the DB Client/Server, CR is simply passing it along.

I don't think Cr has anyway to catch that message other than using the Try/catch and then testing for the message. Of course that is all being generated by the DB so check with them to see if there is a way to handle the messages.

I assume you simply want to pop up your own message that actually means someting or understandable by an end user who knows nothing about connectivity problems?

Try this, it gets the SQL Statement but may point you in the right area:

GroupPath gp = new GroupPath();

string tmp = String.Empty;

try

{

    rptClientDoc.RowsetController.GetSQLStatement(gp, out tmp);

    btnSQLStatement.Text = tmp;

}

catch (Exception ex)

{

    btnSQLStatement.Text = "ERROR: " + ex.Message;

    return;

}

btnSQLStatement.Text is just a text box to display the error text.

Don

Former Member
0 Kudos

I couldn't get that code to compile. I am not a very experienced C# developer. Actually, this is a console application that just creates a pdf from Crystal Reports and saves it to a folder to be accessed by a web page. I want to get the actual PL/SQL error and write to the application log because it will be difficult to debug once in production without it, since it will most likely be a data related issue and I will have limited access to the production data. What I don't understand is why I see the second exception in the report designer, but not in the C# code. Why is Crystal Reports giving a generic error instead of the actual DB error?

0 Kudos

Write the output to a log file... Google it and you'll find code samples.

Don