Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Note
Community interest groups have now moved from Yammer to Microsoft Viva Engage. To join a Viva Engage community and take part in the latest discussions, fill out the Request access to Finance and Operations Viva Engage Community form and choose the community you want to join.
To generate reports as Microsoft Word documents, you must design a template for the reports as a Word document. This template must contain Word content controls as placeholders for data that's filled in at runtime. To use the created Word document as a template for your reports, configure a new Electronic reporting (ER) solution. The solution must include an ER configuration that contains an ER format component. You must configure this ER format to use the designed template for report generation.
In version 10.0.6 and later of Dynamics 365 Finance, you can configure formulas in your ER format to suppress some Word content controls in generated documents.
The following steps explain how a user assigned to the System administrator or Electronic reporting functional consultant role can configure an ER format that generates reports as Word files and suppresses some of the content controls in the generated reports that are configured by using a Word template.
You can complete these steps in the GBSI company.
Prerequisites
To complete these steps, first complete the steps in the following task guides:
- Design a configuration for generating reports in OPENXML format
- Re-use ER configurations with Excel templates to generate reports in Word format
When you complete the steps in these task guides, the following items are prepared:
- A Sample worksheet report ER format that is configured to generate a document in Word format
- A draft version of the Sample worksheet report ER format that is marked as Runnable
- An Electronic method of payments that is configured to use the Sample worksheet report ER format for vendor payment processing
You must also download and save the following template for the sample report:
Review the downloaded Word template
In the Word desktop application, open the SampleVendPaymDocReportBounded2.docx template file that you downloaded earlier.
Verify that the template file contains a summary section that shows the total payment amounts for every currency code encountered in the processed payments.
- The summary section resides in a separate table of the Word document.
- The first row of this table holds the table columns headings as the section header.
- The second row of this table holds the repeating content control as the section details.
- This content control is mapped to the SummaryLines field of the Report custom XML part.
- Based on this mapping, the content control is associated with the SummaryLines element of the editable ER format.
Note
The repeating content control is tagged by the SummaryLines key that matches the field of the custom XML part that it maps to.
Select the existing ER report configuration
For the following steps, reuse the existing ER configuration that you configured when you completed the steps in the previously mentioned task guides.
- Go to Organization administration > Workspaces > Electronic reporting.
- Select Reporting configurations.
- On Configurations, in the configuration tree, expand Payment model, and select Sample worksheet report.
- Select Designer to edit the draft version of the selected ER format.
Replace the current template with the new template
Currently, the SampleVendPaymDocReportBounded.docx file is used as a template to generate the output in Word format. In the following steps, you replace this Word template with the new Word template, SampleVendPaymDocReportBounded2.docx, that you downloaded earlier.
- On Format designer, select Attachments.
- On Attachments, select Delete to remove the existing template.
- Select Yes to confirm the deletion.
- Select New > File.
- Select Browse, and browse to and select the SampleVendPaymDocReportBounded2.docx file that you downloaded earlier.
- Select OK.
- Close Attachments.
- On Format designer, in the Template field, enter or select the SampleVendPaymDocReportBounded2.docx file.
Run the format to create Word output
Go to Accounts payable > Payments > Payment journal.
On Vendor payments, on the List tab, select all the payments.
Select Payment status > None.
Select Generate payments.
In the Method of payment field, select Electronic.
In the Bank account field, select GBSI OPER.
Select OK.
In the Electronic report parameters dialog box, select OK, and analyze the generated output.
The output is presented in Word format and contains the summary section.
Configure the editable format to suppress the summary section
To suppress the summary section in a generated document, based on the request of a user who runs this ER format, modify the editable ER format.
Go to Organization administration > Workspaces > Electronic reporting, and open the draft version of the ER format for editing.
Select Reporting configurations.
On Configurations, in the configuration tree, expand Payment model > Sample worksheet report.
Select Designer.
On Format designer, expand Word, and select SummaryLines.
On the Mapping tab, add a new data source to ask the user, at runtime, whether the summary section should be suppressed:
- Select Add root.
- In Add data source, select General\User input parameter to open User input parameter data source properties.
- In the Name field, enter
uipSuppress. - In the Label field, enter Suppress summary section.
- In the Operations data type name field, select or enter NoYes.
- Select OK.
Add a new data source of the NoYes application enumeration type:
- Select Add root.
- In Add data source, select Dynamics 365 for Operations\Enumeration to open Enumeration data source properties.
- In the Name field, enter
enumNoYes. - In the Label field, enter Suppress options.
- In the Operations data type name field, select or enter NoYes.
- Select OK.
For the selected SummaryLines format element, configure the formula to specify when the Word content control that is associated with the selected format element should be suppressed:
On the Mapping tab, in the Removed section, select Edit to open the Formula designer.
In the Formula field, enter the formula
uipSuppress = enumNoYes.Yes.Select Save, and close the Formula designer.
Note
This formula is applied to a generated document after all other format elements run. To apply this formula, a Word content control that is tagged as a format element that the formula is configured for (SummaryLines in this case) is found in a generated document. The content control is then completely removed, together with the row in the Word table that holds it. The details row of the summary section is removed from the generated document.
At design time, you might configure the Removed formula for a format element, even though no content control in the Word template that you're using has a tag that matches the name of a format element that the Removed property is configured for. When you validate the format at design time, you receive a warning about this inconsistency.
At runtime, an exception is thrown if no content control in the Word template that you're using has a tag that matches the name of a format element that the Removed property is configured for.
On the Mapping tab, in the Removed section, set the With parent option to Yes.
Note
You must set this option to Yes to remove the whole Word table as the parent object of the row that holds the summary section details. If you set this option to No, the section header row remains in the generated document.
Select Save to save your changes to the editable format.
Run the modified format to create Word output
Go to Accounts payable > Payments > Payment journal.
Select the payment journal that you created, and then select Lines.
On the Vendor payments page, select all the rows, and then select Payment status > None.
Select Generate payments.
In the Method of payment field, select Electronic.
In the Bank account field, select GBSI OPER.
Select OK.
In the Electronic report parameters dialog box, in the Suppress summary section field, select Yes.
Select OK, and analyze the generated output.
The output doesn't contain the summary section, because it's suppressed.