Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to get Parameter report use class Controller?

(0) ShareShare
ReportReport
Posted on by 3,805

Hi master..

I have custom report with SSRS Report use class Contract, UI Builder and Data Provider.

in class Contract, i have parameter with enum type.

in ssrs report, i create 2 design with name 'TransDesign01' and 'TransDesign02'.

i want, if i run this report and in parameter i choose 'Buy' in enum type, report will run with output 'TransDesign01'.

and if i choose 'Sell' in enum type, report will run with output 'TransDesign02'.

Can i do it use class Controller? and How?

Thanks all..

*This post is locked for comments

  • Shahil Profile Picture
    635 on at
    RE: How to get Parameter report use class Controller?

    Hi try this out:

    public static void main(Args _args)
    {
        PIL_ReksaDana_Controller controller = new PIL_ReksaDanaTransaction_Controller();
        PIL_ReksaDana_Contract  contract;
    
        controller.parmArgs(_args);
        //this sets your default report - it can be either be your Design_PIL_Reksadana1
         //or Design_PIL_Reksadana2
        controller.parmReportName(ssrsReportStr(PIL_Report, Design_PIL_Reksadana1));
    
        contract = controller.parmReportContract().parmRdpContract();
    
        if (contract.paramTransType())
        {
            controller.parmReportName(ssrsReportStr(PIL_Report, Design_PIL_Reksadana1));
        }
        else
        {
            controller.parmReportName(ssrsReportStr(PIL_Report,Design_PIL_Reksadana2));
        }
    
        controller.startOperation();
    }


  • fajar Profile Picture
    3,805 on at
    RE: How to get Parameter report use class Controller?

    Thanks Tatiana,

    But, i don't understand your code.

    Can you explain to me?

  • fajar Profile Picture
    3,805 on at
    RE: How to get Parameter report use class Controller?

    Sorry for late respond.

    i try your code like this in main method class controller :

    public static void main(Args _args)
    {
        PIL_ReksaDana_Controller     controller = new PIL_ReksaDanaTransaction_Controller();
        PIL_ReksaDana_Contract       contract;
        controller.parmArgs(_args);

        contract = controller.parmReportContract().parmRdpContract();

            if (contract.paramTransType())
            {
              controller.parmReportName(ssrsReportStr(PIL_Report, Design_PIL_Reksadana1));
            }
            else
            {
                controller.parmReportName(ssrsReportStr(PIL_Report,Design_PIL_Reksadana2));
            }

        controller.startOperation();
    }

    and then i create menu item for Object Type 'Class' and Object 'PIL_ReksaDana_Controller'

    And then i open this menu item, But i get error 'Report name is not set. Please set report name using parmReportName method.'.

     

    Please help, Thanks.

  • Community Member Profile Picture
    on at
    RE: How to get Parameter report use class Controller?

    you need to do it in the main method in the controller:

    Create a switch:

    Use the _args to get your enum value.

     switch (_args.dataset())

       {

           case tableNum(InventTransferTable):

               SalesConfirmController::ccc_mainTransfer(_args);

               break;

           default:

               SalesConfirmController::ccc_mainSales(_args);

    IN the CCC_MainTransfer method call the report design

       if(curext() == #ccc)

           {

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

           }

           else if (curext() == #cce)

           {

               controller.parmReportName(ssrsReportStr(SalesOrderAcknowledgementReport, CCE_TransferReport));

           }

    And that it.

    If you need more help let me know.

  • Shahil Profile Picture
    635 on at
    RE: How to get Parameter report use class Controller?

    You can try this in the main method of your controller

    public static void main(Args _args)
    {
            yourController = new yourController();
    
            yourController.parmArgs(_args);
            yourDPContract contract = yourController.parmReportContract().parmRdpContract();
    if (contract.parmBuyEnum()) { yourController.parmReportName(ssrsReportStr(ReportName, TransDesign01)); } else { yourController.parmReportName(ssrsReportStr(ReportName, TransDesign02)); } yourController.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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Microsoft Dynamics AX (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 100 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 48

#3
Zain Mehmood Profile Picture

Zain Mehmood 6 Moderator

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans