Dynamic report filenames in Print archive in Dynamics 365 for Finance and Operations

IMPORTANT NOTICE: From the version 3.3.0 Docentric improves the built-in Print archive by adding features described in this articles out-of-the-box. Find out more >>

If you have a need to save reports to Print archive using dynamic filenames and not the default ones (which are fixed), you can achieve this by using Docentric AX Free Edition. Let’s demonstrate this on the Purchase order report. The built-in Print archive is very limited but changing the Description field of an archived Purchase order to contain Purch ID and Vendor Account, e.g. Purchase order 2018-044 Vendor US-006, you will at least get the ability to search Print archive by purchase ID and vendor.

Changing Description in Print archive of an archived report

Set up first in Accounts payable -> Setup -> Forms -> Form setup the built-in Print archive as the target print destination and run the Purchase order report from the Purchase order confirmation form by clicking the Use print management button. Purchase order will be saved to Print archive with Description PurchPurchaseOrder.Report. This is the default behavior.

Afterwards, set up in Accounts payable -> Setup -> Forms -> Form setup Docentric’s Print archive as the target print destination and run the Purchase order report from the Purchase order confirmation form again by clicking the Use print management button. This time Purchase order will be saved to Print archive with Description Show purchase order. This is actually the report caption that is inferred from the report menu item label.

If we want to change this from Show purchase order  to something else, we can change the default report caption in Docentric report setup. In order to achieve this we need to register the PurchPurchaseOrder.Report SSRS report design in Docentric report setup first, or you can download and install Docentric SSRS Replicas instead.

You can see the whole process on the images below.

How to make Description in Print archive dynamic

Still, this report caption which overrides the built-in report caption would be useless if we cannot make it dynamic, i.e. to contain some report specific information. For example, in case of the Purchase order report this would be Purch ID, Vendor Account, etc.

From the version 3.3.0 Docentric replaces all placeholders within report captions out-of-the-box. Learn more about multiple use of report caption >>

We can achieve this by using a custom Docentric’s DSP class for placeholders (see below). If you are using Docentric SSRS Replicas, you will also need to add X++ code in the overrideReportRunSettings() method to replace all placeholders in the report caption, if any of them is set.

A Custom DSP class for replacing placeholders in print destinations and report caption

Advanced control of both Description and Filename in Print archive

By default, the filename and description of an archived report look the same. But if you need them to be different, or you don’t want to use Report caption to make archived report names dynamic, you can use the following event handlers:

The results you can compare on the images below.

 

Leave a Reply

Your email address will not be published.

*

Docentric respects your privacy. Learn how your comment data is processed >>

Docentric respects your privacy. Learn how your comment data is processed >>