Hi Jsreport team!
Once again I come to you to get some more information, this time it's about passing data to child templates (using handlebars, wkhtmltopdf recipe).
Original plan was to dynamicaly impact the header depending of the content of a #each
loop but couldn't succed nor find anything on that specific case so I decided to go to child template.
After reading your explanation in the Learn section, I tryed this call:
{{#each students}}
{#child child_langaj_company_student.header @data={{ @this }} }
{{#each students}}
But then it wouldn't accept @this
as a valid parameter, so I've updated jsreport to 1.7 (was using 1.6.1 before), then the following error showed instead:
Error occured - Error during rendering report: Error during rendering report: Unexpected token o in JSON at position 1
...
At first it didn't work because it seems the {{ @this }}
was no accepted (did try try then 0
still without success)
then I though maybe I add to add a special parameter so the code would be like this:
{{#each students}}
{#child child_langaj_company_student.header @data.student={{ @this }} }
{{#each students}}
and the report did successfully generate BUT the data passed to the child template would be like none was passed. So all corresponding field stay empty.
Any idea about what I could have done wrong? Or better, any suggestion of how I could pass directly the @this
value into template native header, so I son't have to ressort on child template?
Thank you very much in advance but also for that awesome product that is Jsreport!