Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

Applying extensions to SSRS report

Posted on by 165

Hi,

  I have a question in regards to a recent enhancement in 365 for CustAgingReport.  The requirement wanted to add an additional field(s) to the contract and I created a new class that extends the contract.  The controller class I wanted to do the same thing, though, found that within the CustAgingReportController there is a private method that updates the ReportStr.  The controller class cannot use the extends, with the embedded private method, which means I have to extend from the class SrsReportRunController.  Within the new controller class, changed the references to the Contract to point to the new extension, and while executing I found the new field(s) not being displayed.  Attempted to create an extension on the UIBUILDER and change my controller class to point to the new extension of the UIBuilder.  This time I created a class and added a postHandler for the build method for the new UIBuilder, so I can debug and monitor the processing contract.  The passed in contract was the standard contract, not the new one, which means the new field is not accessible.  So, assuming that pointing the extension to SysOperationContractProcessingAttribute is not being recognized.  And while I wanted to continue even further, realized that the DP class would have to be duplicated, since the contract call, would point back to the standard Contract.  At this point, I backed out of everything, and was informed the parameter was no longer required.  

  My solution was easier to manage at this point, use the new Controller class and add a PostHandler to the DP.ProcessReport method.  This allowed me to control and manage the data, before passing over to SSRS.  

  The question I have is how would you handle the additional parameter within the contract.  With going through the scenario that I described, it seems to be more efficient to create new classes to manage all 4 parts (Controller, Contract, UIBuilder and DP).  Looking for opinions or thoughts. 

Thanks

Bill

*This post is locked for comments

  • Bill Schwagerl Profile Picture
    Bill Schwagerl 165 on at
    RE: Applying extensions to SSRS report

    Hi Sukrut,

     That's what I was thinking, after discovering the extension would not work, the postHandler for the ProcessingReport from the DP class work worked pretty well.  The parameter requirement was moved to the aging definition, which allowed me to proceed without updating the Contract.  

    Thanks for your feedback.

    Bill

  • Bill Schwagerl Profile Picture
    Bill Schwagerl 165 on at
    RE: Applying extensions to SSRS report

    Hi Sohaib,

      The issue is the CustAgingReportController class has a private method called getReportName, which would overwrite this PostHandler call.  Appreciate the suggestion.

    Bill

  • Sohaib Cheema Profile Picture
    Sohaib Cheema 46,610 User Group Leader on at
    RE: Applying extensions to SSRS report

    have you tried using post event handler for controller class, given following sample code.

    class NameOfNewClass

    {

    [PostHandlerFor(classStr(CustAgingReportController), staticMethodStr(CustAgingReportController , construct))]

       public static void ReportNamePostHandler(XppPrePostArgs arguments)

    {

    CustAgingReportController controller = arguments.getReturnValue();

    controller.parmReportName(ssrsreportstr(CustAgingReport, NewDesignName));

    }

    }

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,056 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans