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();

    }
Kenny Saelen
  • 894
  • 1
  • 5
  • 16
elranu
  • 2,292
  • 6
  • 31
  • 55

2 Answers2

1

For debugging purposes, you might want to change the data provider class to run on the client (in this case, the JmgEmplSignedInDP class properties has RunOn=Server).

Remember to remove the option for "Execute business operations in CIL" in your user settings, tab Development.

You can inspect the raw data generated by using af few more lines in the job:

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));
    }
}
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

Kenny Saelen
  • 894
  • 1
  • 5
  • 16
  • Yes, I had already try that. But in a configuration where the AOS, the SQL and the client are in different servers, I couldn't make it work. – elranu Jan 22 '13 at 12:24