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

Save SSRS report in PDF format to Onedrive, SharePoint, or a local network path

(0) ShareShare
ReportReport
Posted on by 1,128

I currently have a report where we enter a date for all the invoices for that date and then in the print settings, I have this setting (see attached).

pastedimage1573228006662v1.png

This generates one PDF with all the invoices for all the customers. Our new requirement is to have separate pdf’s, so we have one invoice per customer on one PDF and so on. This means I need to save them in the PDF format to OneDrive, SharePoint, or a local network path?   How can I accomplish this one?

Thank you!

I have the same question (0)
  • Sukrut Parab Profile Picture
    71,710 Moderator on at

    Which report you are  using ?

  • Ann2015 Profile Picture
    1,128 on at

    It's a custom report we have created which uses controller class which has

    destinationSettings.printMediumType(SRSPrintMediumType::File);

    destinationSettings.fileFormat(SRSReportFileFormat::PDF);

    I want to know how to save the files in separate PDF's

  • Suggested answer
    Sukrut Parab Profile Picture
    71,710 Moderator on at

    Well its depends on how you are fetching data in the report and execution of it. Most probably you  are displaying data for all customers in the one report. If you want seprate PDF for each customer then execute report separately for each customer

  • Ann2015 Profile Picture
    1,128 on at

    Thanks Sukrut.

    But how and where do I save the PDF's? currently since it's just one PDF I am able to give a file name and save in the folder. How can I specify the folder for it to save all the files by customer?

    pastedimage1573243018065v1.png

  • Martin Dráb Profile Picture
    237,896 Most Valuable Professional on at

    Well, what's the meaning of C:\ drive in a web application running somewhere in cloud? While there physically may be such a drive, it's infrastructure that you can't access, so it's the same as if it doesn't exist.

    When you print to a file, it'll ignore the path and it'll give you the file for download, won't it?

  • Suggested answer
    Khushhal Garg Profile Picture
    1,514 on at

    To save file in local network path, you have to upload pdf to Azure blob storage and this can be done with x++. Then have a application running locally that can fetch it from Azure blob storage and store it to local network path. You can use LogicApps to get pdf from blob storage and then write to local network path accessing local network path via ftp.

  • Ann2015 Profile Picture
    1,128 on at

    Yes Martin, it does open the file in PDF and then I can store it wherever I want but my question is how can I separate the pdf's by customer and save them individually? I don't want to do Save As for every customer , it will be great if I can specify that in my code. ?

  • Ann2015 Profile Picture
    1,128 on at

    Khushhal,

    It will be of great help if you can provide an example of this? I am new to this. Thank you.

  • Suggested answer
    Khushhal Garg Profile Picture
    1,514 on at

    If you choose to save the report in PrintArchive then it is storing in blob and when you open the report from Print Archive, it gets URL using following method and opens this URL in browser.

    public void printPreviewSelected()

       {

           PrintJobHeader      selectedOne;

           select selectedOne where selectedOne.RecId == printJobHeader.RecId;

           // Get the report from the DB and download it in the browser

           if (selectedOne.jobType == #SRSArchiveDocument)

           {

               DocuRef docuRef = DocumentManagement::findAttachments(tableNum(PrintJobHeader), selectedOne.RecId, curExt());

               if (docuRef && docuRef.RecId)

               {

                   str docUrl = DocumentManagement::getAttachmentPublicUrl(docuRef);

                   if (docUrl)

                   {

                       Browser br = new Browser();

                       br.navigate(docUrl);

                   }

               }

           }

       }

    You can do same thing to access this URL in your local application and store its content as pdf in local network path.

  • Ann2015 Profile Picture
    1,128 on at

    Thanks for this, I will give it a try.

    But how do I get to save separate PDF's by customer ?

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 544 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 450 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