No exception object

  • Thread starter Thread starter Jon
  • Start date Start date
J

Jon

I don't know what's going on...but I have a function within a class that
loads a crystal report. The report fails to load for some reason, but the
odd thing is that when the debugger goes into the catch statement, ex =
Nothing...what could be happening? This is in VS 2005 with crystal XI R2.

Here's the function:

Public Sub LoadReport(ByVal FilePathAndName As String)
Try
rptActive = New ReportDocument
rptActive.Load(FilePathAndName)
Catch ex As Exception
Throw New Exception("Report load failed" + Environment.NewLine +
ex.Message)
End Try
End Sub
 
Jon,
Interesting, it sounds like a bug in Crystal XI R2!

It sounds like Crystal XI R2 is throwing Nothing, however I don't think that
is even allowed by the CLR!

In VB, the following results in a NullReferenceException:

Dim anException As Exception = Nothing
Throw anException

Are you using the released version of VS 2005 or one of the betas? If your
using a beta, does the same thing happen in the released version?

Unfortunately you may need to contact MS and/or Crystal support directly.

--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net


|I don't know what's going on...but I have a function within a class that
| loads a crystal report. The report fails to load for some reason, but the
| odd thing is that when the debugger goes into the catch statement, ex =
| Nothing...what could be happening? This is in VS 2005 with crystal XI R2.
|
| Here's the function:
|
| Public Sub LoadReport(ByVal FilePathAndName As String)
| Try
| rptActive = New ReportDocument
| rptActive.Load(FilePathAndName)
| Catch ex As Exception
| Throw New Exception("Report load failed" + Environment.NewLine +
| ex.Message)
| End Try
| End Sub
|
|
 
This is the released version of VS 2005 and XI R2. If I put "Throw New
Exception("gg")" line in the same procedure, it catches that just fine.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top