Company logo for all reports

Question Status

Suggested Answer
Shaw asked a question on 23 Apr 2015 5:14 AM

I am trying to add a company logo for all reports. Is there an efficient way to do so? or do I have to add the logo for each report manually?

Reply
Mohammad Raziq Ali responded on 23 Apr 2015 5:31 AM

Hi Shaw,

CompanyInfo companyInfo = CompanyInfo::find();

return CompanyImage::findByRecord(companyInfo).Image;

This code will reflect current company logo

This could be display method in temp table which renders data on report.

Thanks,

Raziq

Reply
Sohaib Cheema responded on 23 Apr 2015 5:37 AM

you need to add it to each needed report, there is no way to add it globally somewhere  to make it applicable everywhere.

Reply
Suggested Answer
Baber Owais responded on 23 Apr 2015 5:58 AM

Hi Shaw,

To display company logo on report, follow the below steps:

1) Add a container type field on report temp table, e.g CompanyLogo.

2) Use the code as Mohammad suggested, and assign the temp table field that value as shown below:

TempTableBuffer.CompanyLogo = CompanyImage::findByRecord(companyInfo).Image;

3) Open report in VS, refresh report dataset.

4) Add Image control on the report design where you want the image to be displayed and use the field Companylogo on that control like Fields!CompanyLogo.

Please verify and let me know if you have further queries.

Thanks,

Baber.

Reply
Jesús R. Abascal responded on 23 Apr 2015 6:24 AM

Also you can use FormLetter::CompanyInfo(), it's the same.

Reply
Suggested Answer
venkatesh vadlamani responded on 28 Apr 2015 1:19 AM

Suggest you to create a new temp table and populate it in a static method of reusable class.Since you have to do it for every report, dont need to add the container field on every report temp table and go about it.

Just get the Dp class to call this static method, add another method to retrieve this new temp table.

Code can be reused this way and only one record insertion with container field helps in performance than getting each and every record populated with container field.

you have to update each and every report with new dataset using the same Dp class

Reply
Suggested Answer
Deepak Agarwal responded on 28 Apr 2015 2:07 AM

Hi You can either use

CompanyImage::findByRecord(companyInfo::find()).Image;

OR

you can add an image under Resources node of AOT and than access this into your code.

TO know how to use resources, follow below link

theaxapta.blogspot.in/.../use-resource-files-in-axapta.html

Reply
Suggested Answer
Roger M. responded on 21 Apr 2017 3:14 AM

as suggested Mohammad Raziq, using this code CompanyInfo companyInfo = CompanyInfo::find(); CompanyImage::findByRecord(companyInfo).Image; you can add it to a tmp table used by RDP class and then add it to your report according you needs. The logo is global and it is in one place. Something useful when it comes to branding. :)

Reply
Suggested Answer
Baber Owais responded on 23 Apr 2015 5:58 AM

Hi Shaw,

To display company logo on report, follow the below steps:

1) Add a container type field on report temp table, e.g CompanyLogo.

2) Use the code as Mohammad suggested, and assign the temp table field that value as shown below:

TempTableBuffer.CompanyLogo = CompanyImage::findByRecord(companyInfo).Image;

3) Open report in VS, refresh report dataset.

4) Add Image control on the report design where you want the image to be displayed and use the field Companylogo on that control like Fields!CompanyLogo.

Please verify and let me know if you have further queries.

Thanks,

Baber.

Reply
Suggested Answer
venkatesh vadlamani responded on 28 Apr 2015 1:19 AM

Suggest you to create a new temp table and populate it in a static method of reusable class.Since you have to do it for every report, dont need to add the container field on every report temp table and go about it.

Just get the Dp class to call this static method, add another method to retrieve this new temp table.

Code can be reused this way and only one record insertion with container field helps in performance than getting each and every record populated with container field.

you have to update each and every report with new dataset using the same Dp class

Reply
Suggested Answer
Deepak Agarwal responded on 28 Apr 2015 2:07 AM

Hi You can either use

CompanyImage::findByRecord(companyInfo::find()).Image;

OR

you can add an image under Resources node of AOT and than access this into your code.

TO know how to use resources, follow below link

theaxapta.blogspot.in/.../use-resource-files-in-axapta.html

Reply
Suggested Answer
Roger M. responded on 21 Apr 2017 3:14 AM

as suggested Mohammad Raziq, using this code CompanyInfo companyInfo = CompanyInfo::find(); CompanyImage::findByRecord(companyInfo).Image; you can add it to a tmp table used by RDP class and then add it to your report according you needs. The logo is global and it is in one place. Something useful when it comes to branding. :)

Reply