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)

Run report and save attachment in local directory in D365FO

(0) ShareShare
ReportReport
Posted on by 3,008

Hello,

It would be glad if someone could assist on below.

Requirement: Run report and save pdf attachment in local path through x++.

I have gone through below article , which worked for AX 2012 not for D365.

http://axcalated.blogspot.in/2014/06/save-sales-confirmation-report-to-pdf.html

In 365 it's prompting to save the file and to choose location. though we are explicitly 

passing directory.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    Hi Krishna,

    Not sure if this is what you are looking for: github.com/.../wiki

    Best regards,

    Ludwig

  • Suggested answer
    Fedir Kryvyi Profile Picture
    1,026 on at

    D365 and its batch runs in Azure, so all files and file processing is done in Azure blob. You cannot force browser to save some file with user permit, that is why you recieve save dialog after file is being create even so you have provided a path.

    AX2012 was hosted as an application in OS and had a full access to file system. But now it is different - imagine that AX would be opened in Safari on iOS, what kind of file path would you pass to dialog to save file?

    I would say that the best user friendly option is to save the log of reports being used(some sort of a table that stores DateTime. UserId and is related to DocuRef, and store your PDF in that table). In that case your user will be able to check and download pdfs from any of his device. But, you cannot force browser to download and save some file in OS.

  • krishna.rao@dax Profile Picture
    3,008 on at

    Hi Fedir,

    Could you please guide me how to generate report in pdf and save in AX table as you said.

    Please suggest..

  • Suggested answer
    Fedir Kryvyi Profile Picture
    1,026 on at

    Unfortunately, I don't have a good example of how you can generate pdf of the report. Basically you need to work with your Controller and pass parameters to it to make it automatically generate PDF

    This code snippet might help

    community.dynamics.com/.../run-ssrs-report-from-code-to-pdf-file

    But in your case you don't need to save file, instead you need to intercept it and get its System.IO.Memory stream. Then you can pass this stream to document management framework to save it in DocuRef. Check DocumentManagement class

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
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans