Image in CUBA report

I am trying to print company logo image in a YARG report.
While I am selecting different fields from the report wizard I get different fields of the FileDescriptor field of company but nothing as image object. I have selected the company.logoImage.name and found the image file name which is normal but not sure how I can get the image itself as I don’t see any option to use ${imageFileId:WxH} as described in the user guide.

27%20AM

Note that I am using Excel file as a template.

Hello @mortozakhan,

You can pass FileDescriptor or FileDescriptor ID in the formatter ${imageFileId: WxH}.
(Field Value Formats - CUBA Platform. Report Generator).

Select ID, the formatter finds image by ID and insert in the report.

Regargs.
Nikita

Hi @shchienko
That’e exactly what I tried as you can see in my post. Problem is, in the report designer, I don’t see option to select the file descriptor object rather fields of File Descriptor as you see in the image above. Any thoughts?

Hello @mortozakhan,

We have a project with examples of the creation of reports. Take a look at it.

And I created a project that prints a report with the picture in xlsx format.

Project:Report-project.7z (56.8 КБ)

Report: Report for entity Image logo.zip|attachment (8.6 КБ)

Regards,
Nikita

1 Like

Hi Nikita
Thank you for the report and sample project.
regards

Hi Nikita
I am trying to use your example to print company logo in the Purchase Order.
The image (FileDescriptor) is in Company Entity which is Associated with PurchaseOrder entity.

I have formatted the field in report design:
image

used the field in the DOCX file as follows:
${PurchaseOrder1.company.logoImage}

and getting the following output in the image field in the report:

com.company.entity.sys.ExtFileDescriptor-a809ef6d-4334-1ca4-0195-6484a734f9ff [detached]

I am not using any view though.

It worked!