I need to show an html block only on the last page of the report.
Using a script I'm able to hide the block only on the first page, on the next pages the blocks is always visible.
Using phantom-pdf instead of chrome-pdf+pdf-utils it works fine.
I shared an example to better understanding: https://playground.jsreport.net/w/sguidotto/3eDStYM6
The script is this below, it is on the headerfooter template called by pdf-utils from the main template:
<!---------------------------- Show blocks on last page-------------------------->
<script>
if (document.getElementById("pagenumber").innerHTML < document.getElementById("totalpages").innerHTML) {
document.getElementById("Totals").style.display = "none";
} else {
document.getElementById("Totals").style.display = "block";
}
</script>
Any suggestion is welcome. Thank you :-)