Tony_Henrich
Tony_Henrich

Reputation: 44115

How to debug XtraReports report even handlers, the scripts, in Visual Studio 2010?

DevExpress's XtraReports adds event handlers, like beforeprint. in some script window. I can't add breakpoints in that window. How does one debug this code? The code is in a resx file.

Upvotes: 0

Views: 3280

Answers (3)

Michael G
Michael G

Reputation: 11

You can add this to your web.config file:

<system.diagnostics>
  <switches>
    <add name="AllowDebugXtraReportScripts" value="true"/>
  </switches>
</system.diagnostics>

Add it within

<configuration>

but below

<configSections>

Upvotes: 0

Alexey Khindikaynen
Alexey Khindikaynen

Reputation: 11

With the next version of the XtraReports Suite (v2011 vol 2) it has become possible to debug scripts using Visual Studio. For more details, see Using Visual Studio for Script Debugging in XtraReports.

Upvotes: 1

AussieALF
AussieALF

Reputation: 339

Unforunately, AFAIK the way that the code is "executed" you cannot debug it at runtime (http://www.devexpress.com/Support/Center/p/Q247866.aspx)

The way I debug mine is by simply placing my code inside a Try Catch, then log the Exception along with any Inner Exceptions as well as the StackTrace. This way I can get information on where the function failed.

This is an example of my Extension method for getting the full exception detail

<Extension()>
Public Function ToFullMessage(ByVal ex As Exception) As String
    Dim result As String
    result = ex.Message & Environment.NewLine & ex.StackTrace
    If ex.InnerException IsNot Nothing Then
        result &= String.Format("{0}{0}Inner Exception{0}{1}", Environment.NewLine, ex.InnerException.ToFullMessage)
    End If
    Return result
End Function

Hope this helps

Upvotes: 0

Related Questions