@admin my mistake, i forgot to add the header i already have...I forgot to mention and add it, so I cannot use pdf utils in that way as im already using it. I updated my playground...is there another way? Or is it possible to add multiple headers (in a specific point and not at the absolute top position)?
Posts made by alesssz
-
RE: How to repeat a part of code in each page?
-
How to repeat a part of code in each page?
Hello, im trying to make a complex page with a lot of data, and because there are a lot of data, i want to replicate the "header" in each page. Here's the playground
https://playground.jsreport.net/w/alesssz/ICUQXYgU
I'd like to repeat each "header"
These parts, in each object (so "Appoggi", "Barriera", "Giunti", "Impalcati" and so on, with their subheaders, like "N° Elem.", "N° Segn.", "Codice", "Note" etc) in each new page, grouped by the data structure.
This is the part of code i want to repeat
<div class="col-sm-12 VI-object-title">{{object}}</div></div> <div class="row header-style"> <div class="col-sm-1 VI-border-right">N° Elem.</div> <div class="col-sm-1 VI-border-right">N° Segn.</div> <div class="col-sm-1 VI-border-right">Codice</div> <div class="col-sm-2 VI-border-right">Note</div> <div class="col-sm-1 VI-border-right">VI</div> <div class="col-sm-2 VI-border-right">Difetto</div> <div class="col-sm-1 VI-border-right">Intensità</div> <div class="col-sm-1">Estens.</div> <div class="col-sm-2 VI-border-left">Dettaglio</div> </div>
I know that tables do that already, but the data structure is too complex to accept tables (or at least, im not good enough to make it work).
Is there any way to do this?
-
RE: Managing 2 different canvas with chart.js
@jan_blaha Sorry i just got back, i was out for a meeting and I answered quickly...too quicky...it seems that was the problem...the nesting
animation
thing actually...and I double checked, in other PDFs it was correct (no wrong nesting). Thank you, that resolved it! -
RE: Managing 2 different canvas with chart.js
@jan_blaha
What do you mean about the nesting part? I always done like that in other PDFs and it always worked....I thought that was good, how should it be then? Like this?options: { maintainAspectRatio: false, devicePixelRatio: 1.5, animation: { onComplete: function () { window.JSREPORT_READY_TO_START = true } }
And about the helper, I put it there because it was a single PDFs, but I have multiple in my project and that helper is defined as a helper tagged to every PDFs,
Any suggestion about resolving this though?
-
Managing 2 different canvas with chart.js
Hello,
I'm trying to draw two different canvas with data that comes through backend API.
The problem is that sometimes one of the two canvas doesn't have data (and that's correct, it depends on data in backend) but the other does.
The commandwindow.JSREPORT_READY_TO_START = true;
in the<script>
tag is working with both of the canvas present, but it doesn't work when one of the two is missing.
I also used acustom if
helper to manage the presence of the canvas, like I'm showing in the playground below.I'm using
empty_dataset
in each dataset (barChart and pieChart) to control when a canvas is shown or not. If you enablewindow.JSREPORT_READY_TO_START = true;
at the end (line 187) it works but the pieChart is partial (the[1]
in the data part should cover the whole pieChart). But if you don't, I would expect this to work with the full pieChart.What am I doing wrong?
Thank you for your time
-
RE: Dynamic number of charts through jquery
@jan_blaha thank you for your answer but it still renders only one chart.
Based on your answer, I figured it out though:
If you separate the "creation" of the html element and the "creation" of the charts, it works as intended.
Here's the playground, if someone had my same problem -
Dynamic number of charts through jquery
Hello everyone,
I'm using JSreport 3.4.1. and Chart.js 3.8.0.
From a server API I'm getting a series of data to create n. charts. The problem is that the number of charts are never the same (they depend on various parameters in a database).
I cannot create n. static charts for the reason above, so I was trying to dynamically create and inject them in the DOM through JQuery, but I'm having some difficulties:
It succesfully create the first chart, but with wrong data (like it isn't waiting for the trigger input), and the second chart isn't shown at all.Any idea on how to create a dynamic number of charts based on the number of objects (inside an array) that arrives through API?
I've set a playground with mock data (not really needed cause I've put static data inside the charts) so you can see what I mean:
playground testThank you