2

Is there any way to debug a DataProvider class, a class that extendes from SRSReportDataProviderBase, When my AOS, my client and my SQL are separated in different servers?

Or there is any way to create a unit test or a job, that I could execute the DataProvider class? so I could debug it? // this question is solved below on the updated

I tryed to create a job so I that I can debug it, but of course their dependencies weren't injected. Here is the example:

          static void Job2(Args _args)
          {
           JmgEmplSignedInDP empl;
           ;
            empl = new JmgEmplSignedInDP();
            empl.processReport();
          }

And I got the following error, becuase it did not have their dependecies:

 JmgEmplSignedInContract object not initialized.
 Stack trace
 (S)\Classes\JmgEmplSignedInDP\processReport - line 12
 (C)\Jobs\Job2 - line 8

There is any way to construct a DataProvider class so I can debug it??


Update:

I could inject the class dependecies, so now I can debug it. It's almost the same. But the initial question has not awnser yet:

Is there any way to debug a DataProvider class, a class that extendes from SRSReportDataProviderBase, When my AOS, my client and my SQL are separated in different servers?

Code to inject dependecies of a DataProvider Class:

    static void Job2(Args _args)
    {
        JmgEmplSignedInDP empl;
        JmgEmplSignedInContract con;
        Query q;
        ;


        empl = new JmgEmplSignedInDP();
        con = new JmgEmplSignedInContract();
        q = new Query(querystr(JmgEmplSignedInQuery));
        empl.parmQuery(q);
        empl.parmDataContract(con);

        empl.processReport();

    }
4

2 回答 2

1

出于调试目的,您可能希望更改数据提供程序类以在客户端上运行(在这种情况下,JmgEmplSignedInDP 类属性具有 RunOn=Server)。

请记住在您的用户设置选项卡开发中删除“在 CIL 中执行业务操作”选项。

您可以在作业中使用更多行来检查生成的原始数据:

static void Job2(Args _args)
{
    JmgEmplSignedInDP empl;
    JmgEmplSignedInContract con;
    Query q;
    JmgTmpEmplSignedIn tmp;
    ;

    empl = new JmgEmplSignedInDP();
    con = new JmgEmplSignedInContract();
    q = new Query(querystr(JmgEmplSignedInQuery));
    empl.parmQuery(q);
    empl.parmDataContract(con);

    empl.processReport();
    tmp.setTmpData(empl.getJmgTmpEmplSignedIn());
    while select tmp
    {
        info(strFmt("%1", tmp.EmplName));
    }
}
于 2013-02-01T13:47:12.127 回答
0

Depends if the code is managed or not, and depending on that you have to use Ax debugging or Visual studio debugging (attaching the VS editor to the AOS process.

But you can find information as to how you have to debug reports on this link : Configure the debugger to debug a report data provider class

于 2013-01-21T22:19:04.837 回答