【问题标题】:How to debug XtraReports report even handlers, the scripts, in Visual Studio 2010?如何在 Visual Studio 2010 中调试 XtraReports 甚至报告处理程序、脚本?
【发布时间】:2011-09-26 18:40:08
【问题描述】:

DevExpress 的 XtraReports 添加了事件处理程序,例如 beforeprint。在某些脚本窗口中。我无法在该窗口中添加断点。如何调试此代码?代码在 resx 文件中。

【问题讨论】:

    标签: devexpress xtrareport


    【解决方案1】:

    在 XtraReports Suite 的下一版本(v2011 vol 2)中,可以使用 Visual Studio 调试脚本。详情请见Using Visual Studio for Script Debugging in XtraReports

    【讨论】:

      【解决方案2】:

      不幸的是,AFAIK 代码“执行”的方式无法在运行时调试 (http://www.devexpress.com/Support/Center/p/Q247866.aspx)

      我的调试方式是简单地将我的代码放在 Try Catch 中,然后将异常与任何内部异常以及 StackTrace 一起记录下来。这样我就可以获得函数失败的信息。

      这是获取完整异常详细信息的扩展方法示例

      <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
      

      希望对你有帮助

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2011-12-11
        • 1970-01-01
        • 1970-01-01
        • 2012-09-23
        • 1970-01-01
        • 1970-01-01
        • 2012-01-28
        相关资源
        最近更新 更多