/ Microsoft / Get company logo in SSRS report

Get company logo in SSRS report

Learn, share and spread knowledge

Company logo is an important part of the SSRS report. Many developers and customization consultant often get this task to show the company logo on the SSRS report. To get company logo in SSRS report, there are two ways as follows:

  • Static
  • Dynamic

Static:

Using this approach, you just need to add the image in the design of the report. But, in future if you change the company logo, you need to again customize the design of the report. This approach is not recommended.

Dynamic:

Using this approach, you need to store the logo in the temporary table of your report. And then add the image in the design of the report using the database. In future, if your logo is changed, you just need to change it in the legal entity and the logo will be changed dynamically on your report.

In this tutorial, I will show you how to get company logo in SSRS report dynamically. Let’s start:

To customize the report in D365FO using extension you need to follow: Customize SSRS report using extension in D365FO

To create SSRS report in D365FO from scratch, you need to follow: Create SSRS report in D365FO

It depends what are you doing. Are you creating report from scratch or are you customizing the report? Anyways, you need to adjust the knowledge I am sharing with you, with your own requirement.

Get company logo in SSRS report

Create a field in table your report is using as follows:

  • Field name: CompanyLogo
  • Data type: Container
  • Extended data type: Bitmap

Note: Build and synchronize the project

In the class, where you are inserting data in your report’s table, add the following code:

CompanyInfo companyInfo = CompanyInfo::find();
tableBuffer.CompanyLogo = CompanyImage::findByRecord(companyInfo).Image;

The above code will get the current company’s logo and assign to the field i.e. CompanyLogo, we have created in start.

  • Open the report
  • Restore the data set of report to refresh the table
  • Save it
  • Open the report design
  • Add the image box in the design as shown in the image below:
Insert image box in the SSRS report

Now, open the properties of the image box and set it as follows:

  • Select the image source: Database
  • Use this field: <Expr>
  • Use this MIME type: image/bmp

Note: <Expr> is as follows:

=First(Fields!CompanyLogo.Value, "DataSetName")

See the below image for reference:

Image properties in the SSRS report

Save, build, synchronize and deploy the report

Now, go to the Organization administration ->Organizations -> Legal entities -> Report company logo image tab. Add the logo of your choice. Now, execute the report and test it.

To get company logo in SSRS report dynamically is well-explained above. If you found any ambiguity or a better solution, please let me know. If this helps you, please Like, Comment and Share to help other community members.

Blog: Click here

YouTube: Click here

GitHub: Click here

You will fall. You will struggle. Rise back up. And push harder. – Unknown

0 POST COMMENT

Send Us A Message Here

Your email address will not be published. Required fields are marked *