- Print
- PDF
How Do I Add the Product Image to a Report?
This article explains how to add the Product image of an item to a report on the line level. The Product image is the thumbnail image that can be added in standard Dynamics 365 to item masters.
It is often beneficial to have these images in a report.
Note
It is possible to directly use a field/method such as EcoResProduct.ProductImage() to add images. This approach makes it much simpler to add images/pictures.'
Example of the Product image on an item master:

The Product image is an attachment that is saved to the DocuRef table. The reference table is the InventTable.
Steps
Navigate to your report in Lasernet > Common > Reports and select the Query wizard.
Click Next until you get to the Tables page.
Add the InventTable to your report's line level.

This will depend on your report, but the InventTable is related to several tables.
Add Docuref to InventTable. The relation should be as follows:

Click Next and add getFileContentAsBase64String() or getFileContentAsContainer(). Finish the wizard.

Open the report's Structure and navigate to the DocuRef Detail section. If you are using getFileContentAsBase64String(), leave it as type String. If you are using getFileContentAsContainer(), set it to type Base64 file.

Close the Structure, run the report, and review the XML. The field(s) for the image are added a Base 64 Strings.

Download the grab file in Lasernet Form Editor and map the image to the report. This can be done by clicking Image > Local > Base 64.

Select an image field and position it as desired.
