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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Approach to take on adding a new report destination option in AX 365?

(0) ShareShare
ReportReport
Posted on by 270

Can anyone give me a general idea on  how to add a new report destination option in AX 365?

I took a look into the standard report printer code and realized that I will need to modify the SRSReportRunPrinter and some other related classes to implement the new print destination option.  However I found the objects belong to Application foundation package can’t be customized, and I am not sure if it can be accomplished by extension method.   

To rephrase , I can extend the SRSReportRunPrinter class to add a new method  for the Web service option, but I will still have to customize the SrsReportRunService class to call the new extension method. However the SrsReportRunService class belongs to Application foundation package, it can’t be customized. What to do here?

Thanks in advance.

*This post is locked for comments

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

    Do you really have to change SRSReportRunPrinter class? To add another destination, it may be enough to add a post-event handler to printReport() method, for example. Note that SRSPrintMediumType is marked as extensible.

    Let us know if you have a problem with some specific change - we may have a solution for you, or maybe we'll confirm that your particular requirement can't be currently achieve and you would have to ask Microsoft to add a new extension point.

    Don't focus on extension methods - they're used for attaching extra methods to types, which isn't what you're trying to achieve in this case.

  • prodev42 Profile Picture
    270 on at

    Thanks for your response, I am trying to pass the XML report data for some of the modified reports with additional fields added (instead of printing it out) and then to display the URL returned in a 3rd party reporting service.

    [quote user="Martin Dráb"]

    Do you really have to change SRSReportRunPrinter class? To add another destination, it may be enough to add a post-event handler to printReport() method, for example. Note that SRSPrintMediumType is marked as extensible.

    Let us know if you have a problem with some specific change - we may have a solution for you, or maybe we'll confirm that your particular requirement can't be currently achieve and you would have to ask Microsoft to add a new extension point.

    Don't focus on extension methods - they're used for attaching extra methods to types, which isn't what you're trying to achieve in this case.

    [/quote]

  • Martin Dráb Profile Picture
    239,647 Most Valuable Professional on at

    It doesn't sound like a new print destination to me; it's still printing to file.

    If your question still is how to implement some change using extensions, please tell us what kind of change you're trying to implement. Maybe you could show us how you would do your change with a customization.

    If you need some help to first architect a technical solution for the requirements mentioned in your last reply, please make clear which part is the problem and then give us more information about it.

    If your intention is to change how AX generate XML files, I don't think you can, because the code is inside a .NET assembly (Microsoft.Dynamics.AX.Framework.Reporting.Shared), but you could potentially attach extra data.

  • Feng Zhou Profile Picture
    1,575 on at

    Hi Martin,

    We'd like to send the XML data to a web service instead of exporting the XML file to browser when we choosing to print a report.  If using post event methods, how can we get the generated XML file?

    thanks

  • Martin Dráb Profile Picture
    239,647 Most Valuable Professional on at

    Alan, what do you mean by "exporting the XML file to browser"? Isn't it referring to a customization of yours that you didn't mention?

    What exactly are you trying to achieve? Create a new print destination for the web service? Or exposing a web service returning XML representation of the report? Or something else?

    Is it the same topic as prodev42's (= the author of this thread)?

  • Martin Dráb Profile Picture
    239,647 Most Valuable Professional on at

    To understand how it's handled by standard AX, look into SrsReportRunPrinter.toFile(). It calls File::SendFileToUser() at the end, which isn't what you want, so you'll have to create a similar method handling the result in a different way (or to customize this method).

  • Feng Zhou Profile Picture
    1,575 on at

    yes, I work with prodev42 on the same task.  Do you have the experience on adding a new print destination for Dynamics 365 for operations?

    there is an existing printing functionality that can export report data to a XML file.  We'd like to add a new destination which will extend the exporting report to a XML file functionality, send the XML file to an external web service instead of exporting the XML file to browser. Does this make sense?

  • Martin Dráb Profile Picture
    239,647 Most Valuable Professional on at

    No, I still don't understand what you mean by "exporting the XML file to browser"? Do you mean printing a report to file and downloading it? (Whether you display the file in a browser, Notepad or anything else isn't important.)

    Then you probably can reuse all logic for the existing print destination of file (with format = XML) and just process the file in a different way (as I discussed above). Have you already looked at it? Is there anything in particular that you need to explain?

    I thought that prodev42 wanted to use a different way for generating XML (with more data), which you didn't mention. Is it out of scope now?

    It would really help if you explained what exact help you need, because I addressed quite a few things and you still ask just very generic questions like "Do you have the experience on adding a new print destination?". Please look at the extensible enum and the classes and methods. If I return to prodev42's original question, he had a problem with implementing somethin g with extensions, but he never explain which exact thing it was - maybe it's now your turn to explain it. I can't tell you how to solve a problem unknown to me.

  • André Arnaud de Calavon Profile Picture
    305,182 Super User 2026 Season 1 on at

    Hi Alan,

    I wonder if you need to use a report with a certain print destination. I understand you need to send xml to a web-service. For that purpose, have a look at the documentation about servicing Dynamics 365 for Operations: ax.help.dynamics.com/.../dynamics-ax-7-services-technical-concepts-guide

  • Martin Dráb Profile Picture
    239,647 Most Valuable Professional on at

    That's why I asked them what they want to achieve and suggested a web service as an option. It's up to them to answer it.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 34

#2
Michel ROY Profile Picture

Michel ROY 14

#3
Jagadabi Profile Picture

Jagadabi 6

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans