Thank you so much,
Bjrmatos.
Posts made by karanamavinash
-
RE: Unable to download csv and pdf Async
Could you please help me with that code.
To know whether a pop up got opened or not.
Thanks -
RE: Unable to download csv and pdf Async
Thank you so much. This works absolutely fine.
One last question.
When the browser blocks the pop ups the renderAsync is not working to open the document in new tab..
ERROR TypeError: Cannot read property 'document' of null.
-
RE: Unable to download csv and pdf Async
For data more than 100 it showing error as follow: PayloadTooLargeError: too many parameters at queryparse (C:\clearview-js-report\node_modules\jsreport-express\node_modules\body-parser\lib\types\urlencoded.js:151:13) at parse (C:\clearview-js-report\node_modules\jsreport-express\node_modules\body-parser\lib\types\urlencoded.js:75:9) at C:\clearview-js-report\node_modules\jsreport-express\node_modules\body-parser\lib\read.js:121:18 at invokeCallback (C:\clearview-js-report\node_modules\jsreport-express\node_modules\raw-body\index.js:224:16) at done (C:\clearview-js-report\node_modules\jsreport-express\node_modules\raw-body\index.js:213:7) at IncomingMessage.onEnd (C:\clearview-js-report\node_modules\jsreport-express\node_modules\raw-body\index.js:273:7) at IncomingMessage.emit (events.js:189:13) at endReadableNT (_stream_readable.js:1103:12) at process._tickCallback (internal/process/next_tick.js:63:19) For data less than 100 jsreport.render function is working properly but when there are more records it showing the above error. To avoid the error I am using jsreport.renderAsync to load the PDF. Which works fine for Viewing, but the document cannot be downloaded. My angular 6 code: *************************************** RENDERING PDF. var request; jsreport.serverUrl = 'http://localhost:1000'; var reportName = "Z-Report"; request = { "data": { "items": this.tableList, "title": "Z report" }, "template": { "shortid": rJbJkmeLE } }; //For data more than 100 i am using Async to load the report jsreport.renderAsync(request).then(function (res) { var html = '<html>' + '<style>html,body {padding:0;margin:0;} iframe {width:100%;height:100%;border:0}</style>' + '<body>' + '<iframe type="application/pdf" src="' + res.toDataURI() + '"></iframe>' + '</body></html>'; var a = window.open("about:blank", "Report") a.document.write(html) a.document.close() }) // for data less than 100 rescords jsreport.render("_blank", request);
This works fine for records less than 100, but the for more records its showing the same error as mentioned above.
For downloading CSV
var request; jsreport.serverUrl = 'http://localhost:1000'; var reportName = "Z-Report"; request = { "data": { "items": this.tableList, "title": "Z report" }, "template": { "shortid": HJ_bJXxUE }, "options":{ "Content-Disposition": "attachment; filename=" + reportName } }; jsreport.render(request);
This works fine for records less than 100, but the for more records its showing the same error as mentioned above.
For downloading PDF ******************************************************************** var request; jsreport.serverUrl = 'http://localhost:1000'; var reportName = "Z-Report"; request = { "data": { "items": this.tableList, "title": "Z report" }, "template": { "shortid": HJ_bJXxUE }, "options":{ "Content-Disposition": "attachment; filename=" + reportName } }; jsreport.download('myReport.pdf', request);
Thanks in advance
-
Unable to download csv and pdf Async
Unable to download csv and pdf Async as i have large number of records to generate.
However async viewing of the pdf is possible.
I am using JSReport with my angular 7 application.
Thanks in advance.