web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Report without contract class

(0) ShareShare
ReportReport
Posted on by

Hi Guys,

Is it possible to have a report with CONTROLLER and DATA PROVIDER class only? I'm not needing the contract class coz the report data filtering is only based on the active record.

Please see screenshot below : 

• As you can see I used variable _dpClass to call the method "getSalesId" in DP class method, why? I fetch the active record to "getSalesId" method of DP class for me to filter the report. 

controller.jpg

Please see debugging screenshot :

• Base on my debugging process under controller class, the line code 17 works good and was able to debug and get the active record.

• I was confused on line code 18 where I called the method from dp class to fetch na value. As per may debugging it gets the correct active record but when I run the report it's all blank.  

4784.debug.jpg

Please see DP class method screenshot below :

5850.dp-class.jpg

I'm quite confuse why it doesn't work to throw value on the public method on my DP class.

Does the way I called my DP class method is not appropriate?

Many thanks for the help guys! 

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Ali Zaidi Profile Picture
    4,657 on at

    Try to compile, CIL and cache clear and run the code again.  By the way, why not use data contract class to pass sales Id as parameter. You can hide Parameter dialog and pass sales Id in controller class as parameter.

    You can follow this link.

    www.tech.alirazazaidi.com/how-to-run-rdp-based-report-through-x-and-pass-parameter-using-datacontract

  • Verified answer
    Martin Dráb Profile Picture
    237,807 Most Valuable Professional on at

    Contract classes are used to hold parameters. You say that you need a parameter (an active record), therefore where would you put it if not to a contract class? Your claim that you don't need a contract class lacks any explanation.

    That you have the record in your controller class before executing the record is nice, but it won't magically appear in the RDP object constructed by the report (possibly on a different server at a different time). You need serializable parameters that the will be used by the RDP class in such a situation, which is exactly the role of contract classes.

  • Community Member Profile Picture
    on at

    Hi Ali Raza,

    Thanks for this. I'll use contract instead and just hide the dialog called by the controller.

    Based on my analysis and debugging the controller class passes parameter on method(only not classdeclaration) in my DP class but controller class only calls the SSRS which runs my DP class. SSRS running my DP class which CLEAR all variables and run as an initial not holding or retaining the parameter I fetch on the DP method. That is why still gets blank result.

    I'll be using your link to hide the controller dialog. Thank you for this very good option.

  • Community Member Profile Picture
    on at

    I've got it and just realize that contract was the one holding all parameters upon prerun of the DP class. Thank you for this Martin. :)

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Scott_itD Profile Picture

Scott_itD 2 Community Manager

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans