Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Contract and controller class

(0) ShareShare
ReportReport
Posted on by 180

Hi All,

How to fetch data in controller and contract class to create a report? I'm already done in generating xml file, but the metadata doesn't any information from the table that I've used.

Thanks for the response.

*This post is locked for comments

  • Chaitanya Golla Profile Picture
    Chaitanya Golla 17,225 on at
    RE: Contract and controller class

    Hi,

    Could you provide some more information about A2X classes as I am not much aware of it or might be known with a different name.

  • ron_ron Profile Picture
    ron_ron 180 on at
    RE: Contract and controller class

    Hi,

    How can I pass the return rec id value of method from contract to a2x class?

    Thanks.

  • ron_ron Profile Picture
    ron_ron 180 on at
    RE: Contract and controller class

    Hi,

    I found the error at A2X class.

  • Suggested answer
    Chaitanya Golla Profile Picture
    Chaitanya Golla 17,225 on at
    RE: Contract and controller class

    Hi,

    Are you getting this error in data provider class. You can check the method processReport of class CustAccountStatementIntDP and implement your code.

    Code: CustAccountStatementIntContract contract = this.parmDataContract();

             fromDate                = contract.parmFromDate();

             toDate                  = contract.parmToDate() ? contract.parmToDate() : dateMax();

  • ron_ron Profile Picture
    ron_ron 180 on at
    RE: Contract and controller class

    Hi,

    When I initialize the value of my contract class

    like this rdpContract as ContractClassName , and when I print my report,  the error pops and its says that the object is not initialized. How to fix it?

    Thank you.

  • Suggested answer
    Chaitanya Golla Profile Picture
    Chaitanya Golla 17,225 on at
    RE: Contract and controller class

    Hi,

    If you have business logic, then we need to use DP class and report can be developed only based on query too.Can you provide us your code, will try to figure out the issue.

    Refer this links:

    (Query Based SSRS report from Scratch Dynamics Ax 2012 R3.)

    https://www.tech.alirazazaidi.com/query-based-ssrs-report-from-scratch-dynamics-ax-2012-r3/

    (Developing SSRS report using Query in Microsoft Dynamics AX 2012)

    https://community.dynamics.com/ax/b/dynamics101trainingcenterax/archive/2013/07/10/developing-ssrs-report-using-query-in-microsoft-dynamics-ax-2012

  • ron_ron Profile Picture
    ron_ron 180 on at
    RE: Contract and controller class

    Hi,

    I used query instead of Report Data provider.

    Is it okay to use DP class?

    I can't call contract = rdpContract as ContractClassName;

    Thanks.

  • ron_ron Profile Picture
    ron_ron 180 on at
    RE: Contract and controller class

    Hi All,

    Is it okay to use DP class?  Because I used query for creating report.

    Thanks.

  • Suggested answer
    István Orosz Profile Picture
    István Orosz 2,137 on at
    RE: Contract and controller class

    Hi,

    You can check SalesInvoiceDP.getDataFromContract() to see how to get contract parameters in report DP class.

    Kind Regards,

    István

  • Suggested answer
    Chaitanya Golla Profile Picture
    Chaitanya Golla 17,225 on at
    RE: Contract and controller class

    Hi,

    Values from contract class are usually retrieved in DP class. Please check the following parameters in your DP class. 

    Class: DP suffix class

    Method: ClassDeclaration

    Parameters: [

       SRSReportQueryAttribute(queryStr(ReportQueryName)),

       SRSReportParameterAttribute(classStr(ContractClassName))

    ]

    Class: DP suffix class

    Method: processReport

    Code: contractclassvaraible= this.parmDataContract() as ContractClassName;

    Retrieving the value:  variable= contractClassVariable.parmmethod();

    You can take reference of following classes to check implementation details: CustAccountStatementIntContract, CustAccountStatementIntController and CustAccountStatementIntDP.

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

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,642 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,371 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans