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

Print files in docuref attachment

(4) ShareShare
ReportReport
Posted on by 247
Hello,
 
We want to auto print files saved in docuref attachment to PO. When PO confirmation report is generated, it should also print the docuref files attached to the PO header.
 
How can i achieve this i.e. to print all the files in docuref to print destination settings of PO confirmation report.
 

Thank you 
Categories:
I have the same question (0)
  • Suggested answer
    Adis Profile Picture
    6,069 Super User 2025 Season 2 on at
    Hi,
     
    This is not possible out of the box, at least not by simple configuration\parameters. Depending which report framework you are using to print the POs, you can add the attachments to the confirmation in the electronic reporting, in case you are using it. Or you can add it to the SSRS report, which is a development\customization of the report.
     
    In case you are using an ISV solution for printing then you can mention it here. We are using dox42 f.e. and with this ISV solution it is possible to print attachments when a PO\Invoice or whatever is printed.
     

    Kind regards, Adis

     

    If this helped, please mark it as "Verified" for others facing the same issue

    Keep in mind that it is possible to mark more than one answer as verified

  • Suggested answer
    Saif Ali Sabri Profile Picture
    2,351 Super User 2025 Season 2 on at
    To achieve automatic printing of DocuRef attachments when the Purchase Order (PO) Confirmation report is generated in Dynamics 365 Finance and Operations (D365FO), a customization or ISV solution is required, as this is not supported out-of-the-box. Below is a solution approach.

    Objective

    When a PO Confirmation report is printed, also print all files attached (via DocuRef) to the PO header, using the same print destination settings.

    🔧 Solution Options

    Option 1: Customization via SSRS Report Extension

    If you're using SSRS-based PO Confirmation reports, follow these steps:
    1. Extend the PO Confirmation Report (PurchPurchaseOrder) Controller/DP class:
      • Customize the report controller to retrieve all DocuRef entries (type: File) linked to the PO header (PurchTable).
      • During report processing, extract the binary data from the attachments.
    2. Print Attachments Programmatically:
      • Use X++ to send the files to the same print destination as the PO Confirmation report.
      • This may involve:
        • Saving files temporarily to a location accessible by the report server or printer.
        • Invoking .NET printing APIs or using a print management extension to handle file types (PDF, DOCX, etc.).
    3. Security and Performance:
      • Ensure only allowed file types are printed (PDF, etc.).
      • Validate access permissions.
      • Avoid blocking report generation if files are too large or corrupted.

    Option 2: Electronic Reporting (ER) with Embedded Attachments

    If you are using Electronic Reporting (ER) for PO Confirmation:
    1. Customize the ER format:
      • Extend the ER configuration to include embedded binary content of attached documents.
      • Attachments will be part of the final PDF output.
      • This works well for PDF-based output only.
    2. Limitations:
      • Only supports certain file types.
      • Files are embedded, not printed separately.

    Option 3: Use of an ISV Add-on (e.g., dox42, Lasernet)

    If you’re using an ISV like dox42, follow vendor-specific setup:
    1. Configure document template and rules:
      • Modify the dox42 template for PO Confirmation to include attachments.
    2. Enable automatic attachment printing:
      • Configure the print job definition in dox42 to handle attachment files.
      • Set rules to determine which attachments should print and when.
    This is often the most user-friendly and low-maintenance approach if you're already using such a tool.

    🔁 Summary

    Option Method Suitability Dev Required
    SSRS Customization Programmatic attachment fetch and print Flexible, complex scenarios High
    ER Extension Embed in ER output Simple needs, PDF only ️ Medium
    ISV Tool (e.g., dox42) Built-in support for attachments Best for users with ISV Low

    📌 Recommendation

    If you’re not using an ISV tool, and require true auto-printing of attached files, then proceed with SSRS report customization. If attachments should be merged or embedded, consider Electronic Reporting.

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
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 456 Super User 2025 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 429 Most Valuable Professional

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans