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)

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

I have the same question (0)
  • Shahil Profile Picture
    635 on at

    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(); }
  • Community Member Profile Picture
    on at

    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.

  • fajar Profile Picture
    3,805 on at

    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.

  • fajar Profile Picture
    3,805 on at

    Thanks Tatiana,

    But, i don't understand your code.

    Can you explain to me?

  • Shahil Profile Picture
    635 on at

    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();
    }


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