web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

SSRS Reprort. The SrsReportRunController does not invokes the main method().

(0) ShareShare
ReportReport
Posted on by 735

Hi All,

I have faced with a bit strange problem. My goal is to develop SSRS report. The requirements were not defined from the very beginning and have been changing day after day, so I had to redevelop it (report) many times. So, finally – the problem: when I try to run the report, it show me the dialog, I’m choosing necessary parameters, but the reports renders the wrong data. Definitely! In my main method (of SrsReportRunController class, the method, which should filter the parameter and pass the correct one – doesn’t invoked. I mean – even if I comment all code in my main the method of the controller class, still: I can see the dialog, I can choose the parameters, the report is renders (with wrong data, but skip it…) – the problem that the main method is not invoking.

Here is the code of my main method:public static void main(Args _args)

{

   ReportController controller = new ReportController();

   controller.parmReportName(ssrsReportStr(DataReport, Report));

   controller.parmArgs(_args);

   controller.createReport();

   //controller.startOperation();

   }

}

createReport() – is the method, where I have a logic to ”filter” my parameter, and provide with correct one.

I have the same result if comment //controller.createReport() and uncomment controller.startOperation();

public static void main(Args _args)

{

   ReportController controller = new ReportController();

   controller.parmReportName(ssrsReportStr(DataReport, Report));

   controller.parmArgs(_args);

   //controller.createReport();

   controller.startOperation();

   }

}

I have the same result if comment all text init.

What I was trying to fix this:

  1. Restart the AOS and SSRS

  2. Clean cache (.auc)

  3. Reset the settings

 

Does anybody had the similar problem? Please share your experience.

Thank you

Oleksandr

*This post is locked for comments

I have the same question (0)
  • Mohammad Raziq Ali Profile Picture
    2,486 on at

    Hi Oleksandr,

    Controller class is stand alone class and main method is the starting point of execution in it.

    I m surprised on your statement that "the problem that the main method is not invoking."

    Please use debugger that would help you in this case.......

    Thanks,

    Raziq

  • Martin Dráb Profile Picture
    238,286 Most Valuable Professional on at

    If you call a report directly, it has no idea about existence of your controller class and is surely won't call any static method on it.

    If you got what you needed, please mark the answers. It will make clear which answers were helpful and the thread itself will be shown as answered.

  • Ragoza Oleksandr Profile Picture
    735 on at

    Martin, I was asking “how to debug the RDP”, because I expected to see the full stack (and hopefully somewhere on the bottom of it to find my main method). Now I see that I was wrong, moreover, I’ve recieved another advise – I have reassigned my MenuItem to the Controller class (instead the SSRS report), so finally I explicitly called it. Martin, Sohiab, thank you for advises

  • Verified answer
    Martin Dráb Profile Picture
    238,286 Most Valuable Professional on at

    Sohaib's code doesn't call main() method, so you shouldn't expect it to be called. If you're executing your report in a similar way, your main() method won't be called either. It's called automatically if you open the controller class through a menu item; otherwise you would have to call it explicitly.

    Why you do want to debug a data provider class if you ask about the main() method on the controller class?

  • Ragoza Oleksandr Profile Picture
    735 on at

    Sohaib, Martin, thank you for your advises.

    Sohaib, I have tried your code and it also create a dialog... (but doesn't invokes my main method (I have placed several info("...") in it - in main()).

    Martin, I would very appreciate if you can advice how to debug the RDP class. When I try to do as described here  msdn.microsoft.com/.../gg724081.aspx (with breakpoint), I have just only two lines in stack:

    [s]    \Classes\PCLESInsuranceReportDP\processReport     12

    [s]    \Classes\SrsReportProviderQueryBuilder\initialize      59

    Any F11 do not help.

  • Martin Dráb Profile Picture
    238,286 Most Valuable Professional on at

    Stop trying random things and start thinking. If you want to see what main() method is called, trying to debug a completely different class (RDP) can't help in any way.

  • Sohaib Cheema Profile Picture
    49,570 User Group Leader on at

    also you may try to run it using code so you can be sure if its pointing to correct controller

    YourControllerClassName objectOfControllerClass;
        Args                args;
        ;
        
        objectOfControllerClass = new YourControllerClassName();
        args = new args();
        
        args.record(PassHereBufferOftABLE);    
        objectOfControllerClass.parmReportName('ReportName.DesignName'); // you can also skip this as you have defined if you have specified it inside controlelr 
        // Set args parameter in the class to the args instance you created
        objectOfControllerClass.parmArgs(args);
        objectOfControllerClass.parmShowDialog(true);
        // Run the report
        objectOfControllerClass.startOperation();


  • Ragoza Oleksandr Profile Picture
    735 on at

    Yes, just now. I used this link as an example community.dynamics.com/.../133439.aspx

    static void debugRDP(Args _args)

    {

       TableTmp tempTable;

       List                         listCategory = new List(Types::String);

       ReportDP       dataProvider = new ReportDP();

       ReportContract contract = new ReportContract();

       contract.parmFromDate( 01\01\2015);

       contract.parmToDate( 31\03\2015);

       contract.parmMonthQuarter(MonthQuarter::Month);

       contract.parmCategory(3); //3 – Is the EnumValue

       dataProvider.parmDataContract(contract);

       dataProvider.processReport();

       tempTable = dataProvider.getPCLESInsuranceReportTableTmp();

       while select tempTable

       {

           info( strFmt("%1" ,tempTable.CalculateInsurance));

    }

    this is what I got in the infolog:

    Error executing code:  (object) has no valid runable code in method 'debugRDP'.

    Stack trace

    (C)\Jobs\debugRDP

  • Martin Dráb Profile Picture
    238,286 Most Valuable Professional on at

    Breakpoints do work in controller classes.

  • Martin Dráb Profile Picture
    238,286 Most Valuable Professional on at

    To simply see whether your method is called or not, put a breakpoint there.

    If it's not called, check what class is associated with your menu item.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
TAHER Mehdi Profile Picture

TAHER Mehdi 3

#2
Martin Dráb Profile Picture

Martin Dráb 2 Most Valuable Professional

#2
Volodya Profile Picture

Volodya 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans