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

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

Controller class -SSRS

(0) ShareShare
ReportReport
Posted on by 275

Hi ,

     This is my Controller class code with two Report Design .

public class GD_CustTransController extends SrsReportRunController
{
public static void main(Args _args)
{
GD_CustTransController controller = new GD_CustTransController();

controller.parmReportName(ssrsReportStr(GD_CustTrans,Report_Group));
controller.parmArgs(_args);
controller.startOperation();

}
protected void preRunModifyContract()
{
GD_CustTransContract contract = this.parmReportContract().parmRdpContract() as GD_CustTransContract;

if(contract.parmCustGroup() != '')
{
this.parmReportContract().parmReportName(ssrsReportStr(GD_CustTrans,Report_Group));
}
else
{
this.parmReportContract().parmReportName(ssrsReportStr(GD_CustTrans,Report_Account));
}
}
}

But I dont see my controller class is working properly with the respective Report as per the if condition.

It works only based on the default report which I have mentioned in output menu items property. Can someone Explain why it always selects the (Report_Account) Report design .

Do I need to make any changes in my controller class in order to call my Another report ?

pastedimage1652448071759v1.png

I have the same question (0)
  • Martin Dráb Profile Picture
    236,258 Most Valuable Professional on at
    RE: Controller class -SSRS

    All these classes are defined in AX, not in SQL Server Reporting Services. Therefore you don't actually want to debug SSRS...

    Only of these classes, the data provider class, is used from reports. Contracts, controllers and UI designers are standard components of the SysOperation framework. It seems that you lack of this framework and you should do something about it. Look at SysOperation introduction, for example.

  • NoobGamer Profile Picture
    2 on at
    RE: Controller class -SSRS

    I want to Debug since I need to understand the basic flow of contract,controller,DP and UIDesigner Classes. I mean from the scratch .

  • Martin Dráb Profile Picture
    236,258 Most Valuable Professional on at
    RE: Controller class -SSRS

    It's great that your precious problem gets resolved and now you understand how to debug your class.

    What exactly do you want to debug in SSRS?

    Regarding links, the first place to look at is the official AX 2012 documentation. Make you get used to consulting it. For example, look at these pages:

  • NoobGamer Profile Picture
    2 on at
    RE: Controller class -SSRS

    Hi, 

        I can able to call my controller class and It works , But I need to Debug the SSRS in Visual Studio , How can I do That , Can you please share me any link regarding debugging 

  • Suggested answer
    abdultp Profile Picture
    867 on at
    RE: Controller class -SSRS

    Hi,

    As you're calling the report through controller class, in the output menu item change the object type to 'class', object to 'GD_CustTransController' & leave the report design as blank.

  • Martin Dráb Profile Picture
    236,258 Most Valuable Professional on at
    RE: Controller class -SSRS

    I see you're using Visual Studio and I don't think that it's correct. I don't think that you've calling your controller from an IL session. I assume you just open it by a menu item or run the class directly, therefore it runs as X++ and you should use the X++ debugger.

  • Noob Gamer Profile Picture
    275 on at
    RE: Controller class -SSRS

    Hi Martin,

           I am getting this Error when I try to Debug the Report . Should I have to enable something ? 

    pastedimage1652696821663v1.png

  • Martin Dráb Profile Picture
    236,258 Most Valuable Professional on at
    RE: Controller class -SSRS

    There are other ways, but let's use the simplest one. Put a breakpoint to your class. Highlight the class in Solution Explorer, right-click and choose "Set as startup object". Then press F5 to run the project.

    There is a saying: “Writing code accounts for 90 percent of programming. Debugging code accounts for the other 90 percent!”. Knowing how to debug code is crucial; invest time into learning how to do it.

  • Noob Gamer Profile Picture
    275 on at
    RE: Controller class -SSRS

    Hi Martin,

           I am new to D365 , I have not tried debugging in f&o . How can I debug after Deploying Reports ?

    Or which class should I have to make as a startup object inorder to debug ?

  • Martin Dráb Profile Picture
    236,258 Most Valuable Professional on at
    RE: Controller class -SSRS

    What did you find when you debugged your code? Does the condition works as expected?

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 2,257

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 913 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 611 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans