Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Suggested answer

Contract and controller class

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.

  • 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.

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,252 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,089 Super User 2024 Season 2

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans