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)

Applying extensions to SSRS report

(0) ShareShare
ReportReport
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

I have the same question (0)
  • Sohaib Cheema Profile Picture
    49,038 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));

    }

    }

  • Bill Schwagerl Profile Picture
    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

  • Bill Schwagerl Profile Picture
    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

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…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Tocauer Profile Picture

Martin Tocauer 4

#2
AlissonGodoy Profile Picture

AlissonGodoy 2

#2
NNaumenko Profile Picture

NNaumenko 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans