Hi,
I want to add an image to my report. Actually my report belongs to a person which contains all person details. Along with all the details i want to add an image of the same person.
All images are in sys_file table. How to do that ?
What to do in the template and how i will fetch the image from table.
Hi
To adjust a report to display images from sys$FileDescriptor do the following:
Add a field for picture to the report template.
Add the corresponding field to the report structure.
Specify the format of the field:
Open Parameters and Formats tab of the report editor and create a new Value format.
Input the name of your field (in the “Band.Field” -format) and select the “${imageFileId:WxH}” as format string. Change “W” and “H” to the values you need (see the attached screenshot).
In the report structure adjust the query for corresponding data set: ID of the file should be passed to the field created above.
Hi,
Thank u for your reply.
But in my case its not working. May be i am not doing in the proper way. I am attaching three screen shots. Can you please check and let me know where i am doing wrong so that i am not getting the image in the report.
We are using cuba file descriptor to store the image for a person. I followed the first step in Add image to Word template from entity - CUBA.Platform show the image in report. Still it is not coming in the report and one exception is coming. I am attaching the screenshots here. Please let me know where I am missing.
SELECT demo_sem1.sem_person.image_file_id as personimage
from demo_sem1.sem_person
inner join demo_sem1.sem_case_header on demo_sem1.sem_person.id = demo_sem1.sem_case_header.person_id
where sem_case_header.id=${caseId}
and i am getting the id as "d130?8a6e93c6b4a9bc2500b8f9e164"
The type of id in sys_file table is varchar(32) not UUID.
Are you using MySQL database?
The “Id” field on MySQL(and Oracle) has Varchar(32) format. The reporting system considers it incorrect.
It is an issue. We will fix it.
As a workaround transform your query to JPQL.
Report with the following query works well in my project.
select e.name as name, e.photo.id as picture from reportwithimages$Person e