How to access variable returned from script to html tag
-
Hi ,
How to access the variable value from script tag to html ,playground url - https://playground.jsreport.net/w/anon/Z2~zOyZa
is assigning shouldAddPageBreak property to report data will work?
i want shouldAddPageBreak value in html to add page break before terms and conditions
-
hi sir,
can u please reply??
is i need to use Handlebars.compile in script tag and combine external variable along with source.
like,
var template = Handlebars.compile(source, { test: true });Can u please help me on how to append external data along with reportt data?
-
@reshmajacob93 this is not possible by design, because at the time your js inside the
script
tag runs the template engine has already run. I think you should be able to reproduce the same by always rendering the content inside the{{#if shouldAddPageBreak}}
but with adisplay: none
and then in your script after your height condition is met you can change the display to 'block' to make it visible, or you can also just create such content with client side js.
-
ok sir i understood .also is page break work in tr tag
<tr id="pageBreakElement" style="page-break-before: always;" class="page-break">
<td>Row 3, Cell 1</td>
<td>Row 3, Cell 2</td>
</tr>in jsreport online it is working but in my jsreport studio (v3.3.0)
-
-
When i add page break in tr tag page break not working in my studio version is 3.3.0(even if we directly run template from studio also page break not working) but works in jsreport online
Template code from jsreport online
https://playground.jsreport.net/w/anon/ukeL~j5B
-
Can you please reply sorry for asking i don't have much knowledge in css
-
the 3.3.0 likely has a very different version of chrome that did not support the page break in this way, if it works on jsreportonline it means you should try it with jsreport 3.13.0 locally to match the same versions.
-
Instead of updating new version is there any other alternative solution? Because our clients where using the reports
-
unfortunately, it seems there is no workaround for older versions. i think you can split the content in different tables and use a normal div for a page break https://playground.jsreport.net/w/anon/I2fIFf0~, however it is probably not something very efficiently to do for a more complex template