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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Get display method on a Query based ssrs report

(0) ShareShare
ReportReport
Posted on by 6,478

Hello,

we have duplicated the SSRS report which has a Query as a dataset.

It is possible to select display methods as fields to be used on report design, for example from CustTable which is one of the data sources of the Query.

I have created CustTable extension class and added a display method to get an Invoice Address from Customer

public display Addressing custInvoiceAddress(CustTable _this)
    {
        Addressing address;
        DirPartyRecId party;
        party   = CustTable::find(_this.AccountNum).Party;
        address = DirParty::getPostalAddressByType(party, LogisticsLocationRoleType::Invoice);
        
        return address;
    }

If I add this method as a field and then use it on report design I'm getting error message when I run the report.

The error message in debugger is: "Unable to read beyond the end of the stream".

So, display method that are already on tables can be used without any problem on report as a field.

Question: How can we add new / extension display methods same way on the report?

Thanks.

I have the same question (0)
  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    Hi,

    did you already test if this display method works in general? For example do you use it on some form? If not, I suggest to try.

    To me the syntax seems wrong - the method should not have any parameters. Perhaps this explains your problem, perhaps not.

    Another thing to try is to add some dummy display method with no logic, and which returns just "foo" or something. And see if you can use that on the report succesfully.

  • huijij Profile Picture
    19,811 on at

    Hi

    You can add new display methods following the link:

    shyamkannadasan.blogspot.com/.../new-display-method-in-form-data-source.html

    regards

  • Johnny Profile Picture
    6,478 on at

    Hi,

    the method works on form if I have it as static.

    I have tested also with runnable class, hardcoded the AccountNum and I can see the correct value is selected.

    I have removed the parameter and error message is now gone, but I'm getting empty value on report.

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    If it's static, then you must provide the record as a parameter. If it's not static, then the underlying table buffer is available via "this" keyword and no parameters should be added to the method.

    Anyway, now the syntax seems to work and you can run the method. Now it's easy to troubleshoot it deeper by either debugging, or changing the method to return different things that you want to have for diagnosis.

    First you can start by returning a fixed text such as "foo". Does it display on the report? If yes, then the logic inside the method doesn't work as you expect, and you need to adjust it.

  • Johnny Profile Picture
    6,478 on at

    I commented out the code and wrote just return 'foo' and nothing is displayed on the report.

    How can I see what is going wrong? Can I restart some services etc?

  • Johnny Profile Picture
    6,478 on at

    I used this approach to solve the problem

    community.dynamics.com/.../display-methods-on-ssrs-report-in-msdyn365fo

  • huijij Profile Picture
    19,811 on at

    Hi Johnny,

    Glad to hear that,Please vertify your answer to close the thread.

    Best Regards

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 559 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 464 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans