Share body data in header
-
Good afternoon
how would I use part of the dataset in the header of a report in which it was merged?
-
The templates rendered through pdf utils operation have the same input data as the original template.
Maybe you can demonstrate the program in a simple playground?
-
Maybe I'm just not accessing the correct property, this is my project but with data examples.[0_1657224575585_example.jsrexport](Uploading 100%)
-
You should be able to access it the same way as on the main template.
Your export didn't upload fully... would you be able able to replicate the problem in the playground? Just two templates and a few lines of input data?
-
I made an example, you can see that the properties logo, company_name, title, subtitle do not appear in the header but are in the root of the data
-
Your problem is documented here.
https://jsreport.net/learn/pdf-utils#input-dataYou are inside loop where the context is different, to get to the root context, you need to use
{{@root.company_name}}
.
-
Thanks, I had already read this topic but I didn't fully understand the idea.