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

Notifications

Announcements

No record found.

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)
  • Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    after making your changes, which you have done, as specified above by you, have you re-opened report in Visual Studio and re-deployed??

    If NOT, kindly do it, because definition of report will not change on reporting server, unless you rebuild and redeploy from Visual studio.

    Make sure as you open the report in Visual Studio, refresh each DataSet and then click save. after that rebuild and redeploy.

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

    if issue is not resolved by what I said above, the do following

    Create an new output menu item and point new Menu item to same report. You should do this only after doing, what I said above (redeployment of report)

  • Suggested answer
    Martin Dráb Profile Picture
    237,970 Most Valuable Professional on at

    If you claim that this main() method isn't invoked and the code works even if the method doesn't contain any code, the obvious explanation is that you're executing some other main() method.

  • Ragoza Oleksandr Profile Picture
    735 on at

    Hi, Sohaib,

    Thank you for quick response.

    Unfortunately all manipulations did not help.

    Yea, I didn’t deployed the report in VS after my editing. But later (after your advice), I’ve done the following:

    1. re-opened report in Visual Studio

    2. refreshed each DataSet and then click save

    3. rebuild and redeploy

    (no result)

    4. Created an new output menu item and point new Menu item to same report

    (no result)

    Any other ideas?

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

    have you tried to call the report by code? I mean calling controller class by code? to make sure how its going

  • Ragoza Oleksandr Profile Picture
    735 on at

    The most strange thing, is that just couple hours ago (before my editing of the logic (not the methods)) it worked as I expected, so I make a conclusion that my main method is the only one method main in my ReportController class. Can you advise how to check whether I’m wrong or not (debugging is not working in SrsReportRunController class (breakpoint as well).

  • Martin Dráb Profile Picture
    237,970 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.

  • Martin Dráb Profile Picture
    237,970 Most Valuable Professional on at

    Breakpoints do work in controller classes.

  • 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

  • Sohaib Cheema Profile Picture
    49,438 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();


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

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
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans