I am using the javascript framework smartclient and IIS(Microsoft server), i install loacal jsreport. I send data to jsreport with smartclient and i cant find a way to save the response as pdf. The solution i have been found is to get response from jsreport as html with browser client with this code inside
jsreport.render({
content:document.documentElement.innerHTML,
engine:"handlebars",
recipe:"phantom-pdf",
phantom: {waitForJS: true }
}) ; , i write this response in html file then render it in new tab and when rendered produced the pdf in new tab. This is not good solution.
Any help?
Thanks in advance B.M.
doc1991
@doc1991
Posts made by doc1991
-
Save pdf file using javascript
-
RE: Generate pdf with html-browser-client
Thanks for fast reply I run it on my local machine. We have many charts with highcharts, when build one of that, it products this error.
In my data find something like this, when rewrite with English the problem solved,
"employee": "?�?�?�?�?�?�?�???� ?�?�?�?�?�?�?�???�". Is this a reason which crash phantom or just happened something else? -
Generate pdf with html-browser-client
When run my template it produces this error.
Error: Command failed: C:\inetpub\jsreportapp\node_modules\phantomjs\lib\phantom\phantomjs.exe --ignore-ssl-errors=yes --web-security=false --ssl-protocol=any C:\inetpub\jsreportapp\node_modules\phantom-html-to-pdf\lib\scripts\standaloneScript.js C:\Users\efstr\AppData\Local\Temp\jsreport\autocleanup\edcc212d-e3be-4233-ba3a-eb8f2ed592ebsettings.htmlat ChildProcess.exithandler (child_process.js:294:12) at ChildProcess.emit (events.js:198:13) at maybeClose (internal/child_process.js:982:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
-
RE: jsreport not rendered or not render properly when crete pdf
Thank you for reply i fined it by using this code in highcharts
series: {
animation: {
complete: function () {
window.JSREPORT_READY_TO_START = wait
}
}, -
RE: jsreport not rendered or not render properly when crete pdf
The image of pdf is this : https://ibb.co/FnDdyGP
-
jsreport not rendered or not render properly when crete pdf
<html>
<head>
<meta charset="UTF-8">
</head>
<script src="https://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://168.jsreportonline.net/extension/browser-client/public/js/jsreport.min.js"></script><script src="https://code.highcharts.com/highcharts.src.js"></script>
<script></script>
<style>
.page-break { display: block; page-break-before: always; }{#asset pdf_style.css @encoding=utf8}
</style>
<body><div id="container" class="page-break"></div>
</div>
</body>
<script>
$(function(){Highcharts.setOptions({ lang: { thousandsSep: '.' } }); var chart = Highcharts.chart('container', { chart: { plotBackgroundColor: null, plotBorderWidth: null, plotShadow: false, type: 'pie' }, credits:{ enabled:false }, title: { text: "My test" }, plotOptions: { pie: { allowPointSelect: false, cursor: 'pointer', dataLabels: { enabled: true, formatter: function() { return Highcharts.numberFormat(this.y, 0, '.'); } }, showInLegend: true } }, series: [{ colorByPoint: true, data:{{{toJSON b.chart }}} }] },function(chart){ window.JSREPORT_READY_TO_START = true
});
jsreport.render({content:document.documentElement.outerHTML,engine:"jsrender",recipe:"phantom-pdf",phantom: {WaitForJS: true }}); });
</script>
</html>With the above code the pdf which created render only legend of highchart and not chart.
![0_1564407682653_Capture.PNG](Uploading 100%)
I have tryed many things but nothink works any help?
Thanks in advance