Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

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

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

  • Mohammad Raziq Ali Profile Picture
    Mohammad Raziq Ali 2,432 on at
    RE: SSRS Reprort. The SrsReportRunController does not invokes the main method().

    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
    Martin Dráb 229,928 Most Valuable Professional on at
    RE: SSRS Reprort. The SrsReportRunController does not invokes the main method().

    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
    Ragoza Oleksandr 735 on at
    RE: SSRS Reprort. The SrsReportRunController does not invokes the main method().

    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
    Martin Dráb 229,928 Most Valuable Professional on at
    RE: SSRS Reprort. The SrsReportRunController does not invokes the main method().

    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
    Ragoza Oleksandr 735 on at
    RE: SSRS Reprort. The SrsReportRunController does not invokes the main method().

    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
    Martin Dráb 229,928 Most Valuable Professional on at
    RE: SSRS Reprort. The SrsReportRunController does not invokes the main method().

    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
    Sohaib Cheema 46,610 User Group Leader on at
    RE: SSRS Reprort. The SrsReportRunController does not invokes the main method().

    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
    Ragoza Oleksandr 735 on at
    RE: SSRS Reprort. The SrsReportRunController does not invokes the main method().

    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
    Martin Dráb 229,928 Most Valuable Professional on at
    RE: SSRS Reprort. The SrsReportRunController does not invokes the main method().

    Breakpoints do work in controller classes.

  • Martin Dráb Profile Picture
    Martin Dráb 229,928 Most Valuable Professional on at
    RE: SSRS Reprort. The SrsReportRunController does not invokes the main method().

    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

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templates⚡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,134 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,928 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans