How to add a list in a DOCX template to generate a report ?

HI,
I want to add a list in a DOCX template for generating a report.
Suppose i have a list of person_name. I want all to be appear in my report.
The query i have written is giving list of person_name. Only want to know how to place it in the DOCX template. So that all the name will publish in the report.

Awaiting for response
Bismay.

Hi,
The list of entities could be printed in DOCX in table. It may be done as described here: https://github.com/cuba-platform/yarg/wiki/Quick-start (see the “Docx report” section).

Hi Rostislav ,
I have tried to get the list of data in my report. but its not working. getting only the first row data. Below is what i have done

This is the query i have written for getting records.


select x.first_name as rel_f_name,
       x.middle_name as rel_m_name,
       x.last_name as rel_l_name 
from demo_sem1.sem_person x 
where x.id in
(select rel_person_i_d_id from demo_sem1.sem_case_header a
inner join demo_sem1.sem_person b on a.person_id = b.id 
inner join demo_sem1.sem_personrelationship c on a.person_id = c.person_i_d_id
where a.id = "9d7c5fb4e0972751901098682dd1b4c2")

This query is returning the following values from MySql database :


rel_f_name | rel_m_name | rel_l_name
     Hari          |        charan      |            das
   Raghu       |         charan     |           das

And this is what i have mentioned in my DOCX template :


##band=Person Relatives :
${Person.rel_f_name} ${Person.rel_m_name} ${Person.rel_l_name}

And this is what i am getting in my report :


Relatives:
Hari charan das

It should be :


Relatives:
Hari charan das
Raghu charan das

How to do that ?
please let me know if i am wrong any where.

Awaiting for your response.
Bismay.

Hi Rostislav ,
I have tried to get the list of data in my report. but its not working. getting only the first row data. Below is what i have done

This is the query i have written for getting records.


select x.first_name as rel_f_name,
       x.middle_name as rel_m_name,
       x.last_name as rel_l_name 
from demo_sem1.sem_person x 
where x.id in
(select rel_person_i_d_id from demo_sem1.sem_case_header a
inner join demo_sem1.sem_person b on a.person_id = b.id 
inner join demo_sem1.sem_personrelationship c on a.person_id = c.person_i_d_id
where a.id = "9d7c5fb4e0972751901098682dd1b4c2")

This query is returning the following values from MySql database :


rel_f_name | rel_m_name | rel_l_name
     Hari          |        charan      |            das
   Raghu       |         charan     |           das

And this is what i have mentioned in my DOCX template :


##band=Person Relatives :
${Person.rel_f_name} ${Person.rel_m_name} ${Person.rel_l_name}

And this is what i am getting in my report :


Relatives:
Hari charan das

It should be :


Relatives:
Hari charan das
Raghu charan das

How to do that ?
please let me know if i am wrong any where.

Awaiting for your response.
Bismay.

Hi
It seems that your template is incorrect.

  1. It should contain a table
  2. The band name (##band=Person) should be put to the top-left cell
  3. The second row should contain fields without band-prefix: ${rel_f_name} I ${rel_m_name} I ${rel_l_name}

Hi
I have already tried that. Still not working. Please look at the image below which is in my template.
coming only the first row data(Single name).

list

Could you share the whole report here?
Find the “Export” button on the Reports screen. It will generate an archive with the report.

Sure. Sharing the archive with the output report.

Case File(1).zip (86.3K)

caseFile.pdf (77.7K)

Hi,
Sorry for my late reply.

In your report you use a single band for all the information. That is the problem. A table for list of entities must have separate band.
In your report create a separate band for list of relatives, and everything should work correctly.

For more information about Report data structure see the documentation.

Regards.