Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

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

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

  • Shahil Profile Picture
    Shahil 635 on at
    RE: Approach to take on adding a new report destination option in AX 365?

    Hi

    If you check out the blog, all the coding bit is basically everything that I've done and my class works fine.

    Nothing special.

  • Feng Zhou Profile Picture
    Feng Zhou 1,575 on at
    RE: Approach to take on adding a new report destination option in AX 365?

    Could you please provide the full code of that custom class?  I've set upbreak point, but it didn't run into there.

  • Shahil Profile Picture
    Shahil 635 on at
    RE: Approach to take on adding a new report destination option in AX 365?

    Okay. The scenario you mention should display the infolog message. You might wanna set up break points and see where it fails.

  • Feng Zhou Profile Picture
    Feng Zhou 1,575 on at
    RE: Approach to take on adding a new report destination option in AX 365?

    Not yet. I just tried to see if a custom class subscribes to the delegate method onPrintReport in SRSPrintDestinationSettingsDelegates class would work.  I added a info("") to my class's first line, wanted to see if it could run into there when trying printing.  Unfortunately didnt see it show up.  

  • Shahil Profile Picture
    Shahil 635 on at
    RE: Approach to take on adding a new report destination option in AX 365?

    Have you created a new report destination? Where are you checking it?

  • Feng Zhou Profile Picture
    Feng Zhou 1,575 on at
    RE: Approach to take on adding a new report destination option in AX 365?

    Yes! that's what we are looking for.

    We create a a custom class and subscribe to the delegate method onPrintReport in SRSPrintDestinationSettingsDelegates class, but it didnt run into my code when I try printing.

    what could I miss?

    ax7npdo.jpg

  • Verified answer
    Shahil Profile Picture
    Shahil 635 on at
    RE: Approach to take on adding a new report destination option in AX 365?

    Hi 

    [quote user="prodev42"]

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

    [/quote]

    Create an extension of the BaseEnum SRSPrintMediumType and add your new report destination:

    Customizations.png

    Next you want to create your own class and subscribe to the delegate method onPrintReport in SRSPrintDestinationSettingsDelegates class and add your customization in there:

    Customizations.png

    For more info you can check out a post I wrote. Hope this is what you were looking for.

  • Martin Dráb Profile Picture
    Martin Dráb 230,056 Most Valuable Professional on at
    RE: Approach to take on adding a new report destination option in AX 365?

    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.

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,219 Super User 2024 Season 2 on at
    RE: Approach to take on adding a new report destination option in AX 365?

    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
    Martin Dráb 230,056 Most Valuable Professional on at
    RE: Approach to take on adding a new report destination option in AX 365?

    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.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,219 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,056 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans