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)

Call Static X++ Methods/display methods from a Report Data Method in Ax2012 R2

(0) ShareShare
ReportReport
Posted on by 3,248

Hi all

I am trying to display a string data in my ssrs report , information, that should be displayed is not part of Temporary table, according to the design, it is not good idea to add it as a part of temp table, since the same information will be repeated for all rows. And the table from which the data should be fetched is not part of the report data-source.

I have 2 approaches in my mind.

1. call display method written on the table, from the DataMethod of the report. i dont know how to do it.

2. call static method written on the table, from datamethod written on the ssrs report.

I have written below method but when i try to build the solution it throws some errors.

public static string getDate(string proposalID)

   {

       AxaptaWrapper axapta = SessionManager.GetSession();

       string dates = (string)axapta.CallStaticRecordMethod("ProjProposalJour", "GEN_getDates", proposalID);

       return dates;

   }

error

Error 1 The type 'Microsoft.Dynamics.AX.Framework.Reporting.Shared.IReportSessionInfo' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.Dynamics.AX.Framework.Reports.Shared, Version=6.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. C:\Users\pradeep.itnal\AppData\Local\Temp\5\Microsoft Dynamics AX\C Sharp Projects\psamanageinvoicereport.businesslogic\PSAManageInvoice.cs 44 9 psamanageinvoicereport.businesslogic

any pointers??? what needs to be chnaged i am not C# developer ,i am not sure what is wrong here...

*This post is locked for comments

I have the same question (0)
  • Martin Dráb Profile Picture
    237,882 Most Valuable Professional on at

    You can use display methods in the same way as fields, if you use "Query" data set type. Don't bother with anything more complicated unless you have to.

  • Pradeep Itnal Profile Picture
    3,248 on at

    hi Martin,

    I am working, on a precision design, whose data source type, is RDP, so I think there is a way, but a not easy way out.

  • Shaimaa Abo Gabal Profile Picture
    on at

    Hi ,

    i faced the same issue while i used RDP data source.

    did  u solve your problem?

    i need the solution urgently.

  • Pradeep Itnal Profile Picture
    3,248 on at

    you can pass it as a parameter to the report and show it on the report body. if you cannot use display method.

    but if you are running a Querybased report you can use display method as a field and show it on report.

  • Suggested answer
    Community Member Profile Picture
    on at

    as per my suggestion for all these case if you are using RDP data source

    you need to consider creating a field and assign value as per logic, which you are thinking to write in data method.

    that particular field will be available as part of RDP dataset to the report

    This approach is verify simple and preferred as all the report logic remains at one place in AX

    if you care SSRS report data method then you need to check if you have included all the supporting component and no compilation error is there

    please verify and let me know if you need more support.

  • Suggested answer
    Kumar Gaurav @ MS Profile Picture
    on at

    Consider creating a non visible , non mandatory parm method in contract and set the values from DP process report method.

  • Dynamic Sax Profile Picture
    20 on at

    The best answer depends on your data structure.  If you're already fetching your main report data in C#, you can probably keep playing around with the code you're working with.  Also, you should not already be fetching your main report data in C#.

    You can always make a display method on your table, then create a query on this table with the firstonly option checked (for speed).  You can then bring this query in as a new dataset, selecting your display method as the field.  You can call it from anywhere in the design using First(Fields!MyField.Value, "MyNewDataSet")

    If your report data is an RDP already, just add the field to each row.  Your overhead won't be worth the confusion in your coding.  Remember, you're going to have to look at this thing 2 years later and try and remember what you did.  Certainly don't call the display method while building each row, store it in a variable once.

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
Sukrut Parab Profile Picture

Sukrut Parab 2 Moderator

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans