Child template bind with different json file
-
Hi,
Is it possible to bind child template with different json file and parent template with different json file and render child template in parent.
I tried it but child template is not showing any data of json file.
Thanks in advance.
-
Unfortunately the data flows to the child from the parent.
Can you try to describe your particular use case? Maybe there is a solution using scripts or assets.
-
Hi,
Thanks for reply.
Please have a look
https://playground.jsreport.net/studio/workspace/rkYn7WaCg/211
Here when I run childtemplate individually then it show data but when I run parent then childtemplate do not show data.Thanks in advance.
-
Yes, that I understood. I was rather curious why you need different data in child.
In every case maybe this ugly hack would work for you. Check it out
https://playground.jsreport.net/studio/workspace/rkYn7WaCg/214
-
Hi Jan,
Thanks for reply.
It's working. Is there way to hide parent header on child template.Actually I do not want to show header of parent on child template.
Thanks in advance.
-
What kind of header do you mean? A pdf page header? I don't see it meaningful that child template would alter parent. It is likely not possible.
-
Hi Jan,
In parent template I set the header by phantom pdf tab.I want to hide this header on child template.
How can we achieve this?Thanks in advance.
-
I thought that it is this case. I don't understand why would you want to do this. Could you elaborate a bit on this?
Thank you
-
Hi Jan,
The requirement is that some of the pages(sub reports) within the report will have different header images.
Also can we set recipe at run time?
Suppose we have a report whose recipe is phantom pdf and we want to use this as sub report.Thanks in advance.
-
Ok. This doesn't work with phantom anyway. You can hide headers only based on the page number from within the header using javascript. This is why you also cannot hide header from within the child template. This is the phantomjs limitation.
The child templates also shouldn't have phantom-pdf recipe. See the docs for more info https://jsreport.net/learn/child-templates
-
Thanks