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 :
Microsoft Dynamics AX (Archived)

Calling SSRS report from list page for selected record in Ax 2012

(0) ShareShare
ReportReport
Posted on by 515

Hi all,

I have below requirement-

On Transfer Order list page I have to add new menu item button. On click of this button it will show dialog which will have only print setup window (no other parameter). When I will click OK then it should process SSRS report for that selected Transfer order.I created report using RDP. I initially created tmp table, & DP class & query objects but with this I was unable to achieve my requirement later I created contract & controller classes too.

but now I am getting some error.

I have below queries:-

1. Does it require to create controller & contract? Or can I simply write some code to call Output menuitem by passing some ARGs where I will attach SSRS report for that output menuitem?

2. Can anybody give me some pointers or sample code for same?

Thanks in advance.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Luan Nguyen Profile Picture
    689 on at
    RE: Calling SSRS report from list page for selected record in Ax 2012

    set controller class into object of menuitem then set menu item into button report on your form

    here is controller class

    protected void prePromptModifyContract()
    {
        ;
    
        if(!contract)
        {
            contract = this.parmReportContract().parmRdpContract();
        }
        contract.parmTranserOrderId(transerOrderId);
        super();
    }

    public static void main(Args args)
    {
        TranferOrderRptContract        contract;
        TranferOrderRptController      control;
        TranferOrderTable                      tranferOrder;
        ;
        contract = new TranferOrderRptContract();
        control  = new TranferOrderRptController();
    
        control.parmReportName(ssrsReportStr(TranferOrderRpt,Report));
        control.parmArgs(args);
        tranferOrder= args.record() as TranferOrderTable;
        control.parmTranferOrderId(TranferOrder.TranferOrderId);
        control.parmShowDialog(false);
        control.startOperation();
    }


    From now on you can process normal RDP way

  • Dhanshri Profile Picture
    515 on at
    RE: Calling SSRS report from list page for selected record in Ax 2012

    Hi sohaib

    Can you pls send me one link where i will get exact code.? I tried to call controller as you said from my form but on report it is not fetching correct value.. even in controller main function args is retriving blank record...it will be great help if you can give me pointers for this where i will get code on controller,form,in dp .processreport method...

  • Sohaib Cheema Profile Picture
    47,776 User Group Leader on at
    RE: Calling SSRS report from list page for selected record in Ax 2012

    Requirement/need to have a contract class depends upon if you have got any parameters in your report. If you don't have any selectable parameters in your report, you don't need a contract class/ The presence of contract class is not must for controller class.

    While you will create/develop controller class, you can also mention a specific report design in your controller class. This is done by using parmReportName(). If you interested in source code, you can find many examples on search engine.

  • Dhanshri Profile Picture
    515 on at
    RE: Calling SSRS report from list page for selected record in Ax 2012

    Thanks Sohain for immediate reply!

    Does it require to create contract class too?

    How my controller & SSRS will link together?

  • Sohaib Cheema Profile Picture
    47,776 User Group Leader on at
    RE: Calling SSRS report from list page for selected record in Ax 2012

    Hi Shri,

    yes you need to create controller class. and then you need to pass current record to your controller class. That will handle to open report with currently passed record.

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…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Syed Haris Shah Profile Picture

Syed Haris Shah 9

#2
Mea_ Profile Picture

Mea_ 4

#3
Martin Dráb Profile Picture

Martin Dráb 2 Most Valuable Professional

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans