Hi
How to display Company Logo and Company Address in a report.
Thanks
*This post is locked for comments
Hi
How to display Company Logo and Company Address in a report.
Thanks
*This post is locked for comments
Hi Jsshivalik,
As an example please take a look at report 206.
Company Logo
You will see in the OnInitReport trigger a case statement where the Company Information is retrieved and the Picture field is calculated. If you would like to display a single image just create a record variable for the Company Information table, GET the company information and calculate the Picture field.
CompanyInfo.GET; CompanyInfo.CALCFIELDS(Picture);
Add the CompanyInfo.Picture to your dataset
In the RDLC layout you can right click the report and click Insert/Image
Right click the image and choose the image properties
Select Image Source: Database and select Image/BMP in the use this MIME Type field.
Go to the use this field and open the expression with the FX button:
Enter this code:
=Convert.ToBase64String(Fields!CompanyInfoPicture.Value)
Company Address
In the Sales Invoice report you can find this line of code:
FormatAddr.Company(CompanyAddr,CompanyInfo);
This is using the Format Address codeunit 365.
The method takes the address array and the company information record and it will populate your array with the elements of the address.
The CompanyAddr is an array declared like this:
The elements of the array are added to the dataset like this:
After this you can select these fields in a textbox or tablix as values.
I hope this helps.
I think after this you will be interested in how the Code.GetData and Code.SetData is implemented in these reports as the Company Address lines are displayed in report 206 this way. Please refer to this video: How Do I: Use SetData and GetData in Microsoft Dynamics NAV 2013 R2
André Arnaud de Cal... 291,711 Super User 2024 Season 2
Martin Dráb 230,458 Most Valuable Professional
nmaenpaa 101,156