Programaticaly need to disable a template if it comes with no data or null
-
Hi,
I'm having the following problem that I don't know how to solve and the solutions I come up with are not entirely working.
To start, I have a report that has this line to start a number of templates:
{{{pdfCreatePagesGroup reportName="Valuation" logoImageData=logoImageData}}}
and it's pdf util operations as this:
So, what I want to do is to programmatically disable (untick) the, for instance,
valuations-template-ecd
in the screenshot above, if its data come asnull
I was trying to wrap the whole template into an
{{#if}}
statement from<html> to </html>
and closing the{{ /if }}
but, while this solution partially works, for some reason is rendering two Table of Contents page (where it should be only one) and one empty.Overall I need to disable a template (I cannot manually do it from the pdf utils operations tab), based on the data received as
null
.Thank you endlessly in advance for any help :)
-
Hi @ifrantar I'm not sure but this might can help you.
https://forum.jsreport.net/topic/2939/how-to-hide-page-appended-with-pdfutils-when-data-is-null-on-that-page
-
You may use a script to dynamically call PDF utils operations
https://jsreport.net/learn/pdf-utils#usage-in-script
https://playground.jsreport.net/w/admin/UpVVJcAkOr you can use a script to just dynamically disable the particular operation
https://playground.jsreport.net/w/anon/LO61gIKh
-
Thanks a mill @Happy-Patel and @admin
I think you second solution, @admin is what I needed. I checked there and is working perfectly. I needed to dynamically get to the operation enabling and disabling of a template. I'll explore the other options as I think there's of bit of that I need to account for.
Thanks both of you for your time! ;)