Images can be used to enhance the appearance and readability of reports. In Dynamics 365 Finance and Operations, images can come directly from the software saved to Docuref.
To learn how to add images from Dynamics to a Lasernet report please see:
For links to the examples that accompany this article:
If necessary, images can be saved outside of D365FO. This article will explain how to use alternative storage options to add images to a D365FO report.
Examples will be provided on how to use the Lasernet Form Editor Image function to retrieve images from the alternative storage using information from the XML produced by the Lasernet Connector. In these articles, we will add product images to a sales quotation from File Storage and from Azure Storage.
Prerequisites and Best Practice
1. Create a repository of images that will follow reliable naming conventions. When using alternative storage, file names and path information will not be stored in D365FO. It is therefore important to apply the naming conventions used for the image files to retrieve the appropriate image.
2. If using Azure Storage, a container needs to be created. This can be done in the Azure Portal by navigating to the correct storage account and selecting New Container.
In this case, we have product images and have named the image using the item Id, followed by the color Id, followed by the size Id.
4. Ensure the Lasernet Server will have access to this storage.
Lasernet Connector Setup
On the Lasernet Connector side, we will add all the needed information regarding the location and name of the image to the XML.
1. Open the report in Lasernet > Common > Reports.
2. Add the table InventDim under CustQuotationTrans.
3. Add the field ItemId for the first part of the image name.
4. Add fields InventColorId, InventSizeId, and InventStyleId for the rest of the image name. Finish the query wizard.
5. Open the structure for the report. We will use the structure to add custom fields for the alternative storage path, folder, and image extension that will be used for this report. These fields can be added at the Header level of the Structure if the path will be the same for all the images in this report.
6. Run the port to generate an XML. The XML has all the components needed to find the appropriate image in the File System.
Example 1: File System Storage
Having taken the steps outlined on this page, it will now be necessary to add the actual images. For a detailed walkthrough of how to add images from the File System, please see: Using File System storage options to add images to a D365FO report.
Example 2: Azure Storage
For a detailed walkthrough of how to add images from Azure Storage, please see: Using Azure Storage options to add images to a D365FO report.