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
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.
Could you please provide the full code of that custom class? I've set upbreak point, but it didn't run into there.
Okay. The scenario you mention should display the infolog message. You might wanna set up break points and see where it fails.
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.
Have you created a new report destination? Where are you checking it?
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?
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:
Next you want to create your own class and subscribe to the delegate method onPrintReport in SRSPrintDestinationSettingsDelegates class and add your customization in there:
For more info you can check out a post I wrote. Hope this is what you were looking for.
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.
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
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.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,219 Super User 2024 Season 2
Martin Dráb 230,056 Most Valuable Professional
nmaenpaa 101,156