Attaching files to a dox42 report

Prev Next

You can attach a document or an image to a report in D365 FSCM, for example, to a sales order. This attachment can then be printed on the dox42 report or added to a generated e-mail.

Step 1: Setting up in D365 FSCM

Steps

  1. Mark the desired dox42 report and select the Attachments button.

    Report setup interface showing SSRS reports and attachment options for document generation.

    Report setup in D365 FSCM

  2. Create a new attachment and fill out the following fields:

    1. It is possible to enable and disable an attachment type.

      The related data defines where the attachment will be attached.
      For example, in this case on the header (to set up the related tables, use the Related data button. If there are no records by default see: No records in related data for dox42 reports).

    2. The Type dropdown defines the file type of the attachment.

    3. If the Add to report data source checkbox is set to Yes, the files will be available in the report data source.

    4. If the Attach to email checkbox is set to Yes, the files will be attached to a generated email when using the “Email” printing destination.

      Settings for file attachments in the Sales Confirmation module of Finance and Operations.

      Attachment configuration

  3. Create an attachment.

    Sales order management interface displaying various customer accounts and order statuses.Document preview showing details of the dox42 Server file attachment for sales orders.

Result

If the report is now printed, the attachment will be shown in the dox42 report.

Step 2: Setting up in the dox42 FSCM Module

After setting up the new Attachment data in D365 FSCM, the data source will be available for the report in the dox42 FSCM Module.

D365 FSCM report data source configuration for SalesConfirm and AttachmentData table fields.

AttachmentData data source

The Base64Data data field contains the attached file for the report as a Base64 encoded string.

To show the file in the report design, you need to add the new dynamic field to the data source.

Steps

  1. In Word go to the dox42 ribbon and select Data Map.

    Toolbar displaying various functions like Generate, Data Map, and Refresh Template options.

    dox42 ribbon

    The Data Map Designer window opens.

  2. Select the Attachment data data source.

  3. Select the Dynamic Field button.
    The Dynamic Field window opens.

  4. Enter a name.

  5. Enter the following Visual Basic Code:
    result = System.Convert.FromBase64String(AttachmentData.Base64Data)

    Data Map Designer interface showing dynamic field and D365 FSCM report options.

    Example configuration for an Attachment Data Field

  6. Select OK.

  7. Select File > Save to save the changes to the Data Map.

Result

You have created a dynamic field for an attachment that you can insert via the dox42 Data Fields pane.