Thank for you bjrmatos for feedback
Rodrigo Americo
@Rodrigo Americo
Posts made by Rodrigo Americo
-
RE: How to working with child template
I Sorry, I'm Brazilian, and, my English is still not very good, so I often do not express myself correctly in the language. I was able to solve the problem, I will post below so others can use this example:
I have three files: clientes(parent template), childClientes(child template) and dataClientes(data in json)
The parent template will show name and document, and child template will show items descriptions.
Below is the content of the files:dataClientes(data in json)
{
"students" : [
{
"id": 1,
"name":"Robert",
"document": "324234234",
"items":[{"description":"pen"}, {"description":"pencil"}]}, { "id":2, "name":"Peter", "document": "3423423", "items":[{"description":"erase"}, {"description":"pen"}] } ]
}
clientes(parent template)
<meta charset="UTF-8">
<br><br>
<table width="100%">
<p><th align="left" width="50%">Name</th></p>
<p></p><th align="left" width="50%">Document</th></p>
</table>
{{#each students}}<table width="100%">
<tr>
<td width="50%">
{{name}}
</td>
<td width=50%>
{{document}}
</td>
</tr>
<tr> </tr>
<tr>
{{#each items}}
{#child childClientes @data.value= {{description}} }
{{/each}}</tr> {{/each}}
</table>
childClientes(child template)
<table>
<tr>
<td> {{value}}</td>
</tr>
</table> -
How to working with child template
Please, I have two table :
client:
atributes:
id
nameitems:
id
descriptionand I need to do a report that show this way:
name: John
description: pencil
description: pen
name: Peter
description: erase
description: penI need to use child templates for this, but I don't know how to implement. Do you have someone example?
Best regards
-
RE: For with counter JsRender not working in JSReport
Great! Thank you very much!!!
-
For with counter JsRender not working in JSReport
I'm trying to run this code in JSReport but not working. I'm get Total without value. I'm starting in jsreport, please, help me with this problem.
{{*window.total = 0}}
{{for students}}
{{total += 1}}
{{/for}}
total {{: total}}
Data
{
"students": [
{
"nome": "Rodrigo",
"cpf": "3432423423"
},
{
"nome": "Jose",
"cpf": "4134231412"
}
]
}Regards,
Rodrigo
-
Label in JSReport
Please, JSReport print label too? Because I need a report tool that has this resource.
Regards,Rodrigo Americo