Printing a logo in an excel file, using D365FO
Amigos, Here is a small write-up that explains how to print a logo in an excel file, when you have created the Excel file through X++ code. The inherent problem with printing logo in an x++ generated files is: the logos stretch across several columns, and they are very hard to position to a particular location/cell, automatically. The following code, first gets the Logo image and then poses it at the start of the document, across first two cells. Here are the steps: Before you begin, you need the following references: using System.Drawing; using OfficeOpenXml.Drawing; a. Get the image container: private container getCompanyImage() { CompanyInfo companyInfo = CompanyInfo::find(); return CompanyImage::findByRecord(companyInfo).Image; } Here for example, you are trying to print the company logo. b. Draw the logo and pose it across the first two columns of the file...