Thanks!!
Joseph Rezuke
@Joseph Rezuke
Posts made by Joseph Rezuke
-
RE: PayloadTooLargeError
Nice bjrmatos! Once I took out the content-type header the renderAsync worked. I am evaluating your product and it looks very good. It looks like you put a lot of thought into it. Is there a place where one could go for custom extensions?
-
RE: PayloadTooLargeError
Thanks bjrmatos for replying. I increased the inputRequestLimit to 80mb and still get the "too many paramaters" error. If I use async I get the following error:
2017-12-07T16:49:02.244Z - error: Error during processing request: http://localhost:5488/api/report details: Could not parse report template, aren't you missing content type? undefined
-
PayloadTooLargeError
I am getting the following error:
2017-12-07T10:18:44.956Z - error: Error during processing request: http://localhost:5488/api/report details: too many parameters PayloadTooLargeError: too many parameters at queryparse (C:\0\programming\0projects\jsServer2\node_modules\body-parser\lib\types\urlencoded.js:150:13) at parse (C:\0\programming\0projects\jsServer2\node_modules\body-parser\lib\types\urlencoded.js:75:9) at C:\0\programming\0projects\jsServer2\node_modules\body-parser\lib\read.js:116:18 at invokeCallback (C:\0\programming\0projects\jsServer2\node_modules\raw-body\index.js:262:16) at done (C:\0\programming\0projects\jsServer2\node_modules\raw-body\index.js:251:7) at IncomingMessage.onEnd (C:\0\programming\0projects\jsServer2\node_modules\raw-body\index.js:307:7) at emitNone (events.js:105:13) at IncomingMessage.emit (events.js:207:7) at endReadableNT (_stream_readable.js:1056:12) at _combinedTickCallback (internal/process/next_tick.js:138:11) at process._tickCallback (internal/process/next_tick.js:180:9)
I am creating a report that dynamically creates the headers and rows. This is the template:
<table cellpadding="5" cellspacing="5"> <tr> {{#each columnHeaders}} <td>{{name}}</td> {{/each}} </tr> {{#each rows}} <tr> {{#each columnValues}} <td>{{value}}</td> {{/each}} </tr> {{/each}} </table>
The recipe is html and the engine is handlebars.
In my angular client app I am dynamically creating the data. This is my code:
toReport(){ this.reportData.columnHeaders = new Array(); this.reportData.rows = new Array(); console.log("toReport reportData:", this.reportData); let that = this; this.data.forEach(function(item, index){ let len = item.length; if(index === 0){ //headers item.forEach(function(item2, index){ let colh = new ColumnHeader(item2); that.reportData.columnHeaders.push(colh); }) } else{ let row = new Row(); row.columnValues = new Array(); item.forEach(function(item2, index){ //console.log("values", item2, index); let colv = new ColumnValue(item2); row.columnValues.push(colv); }) that.reportData.rows.push(row); } }); console.log("reportdata:", this.reportData); let url = "http://localhost:5488/api/report"//"https://frail.jsreportonline.net/api/report"; var request ={ "template": { "shortid" : "HyBItB4Zf" }, "data": this.reportData, "contentType": "application/json" } this.jsr.serverUrl = "http://localhost:5488" //"https://frail.jsreportonline.net"; this.jsr.headers['Content-Type'] = "application/json"; this.jsr.render('_blank', request); // this.jsr.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 src="' + res.toDataURI() + '"></iframe>' + // '</body></html>'; // var a = window.open("about:blank", "Report"); // a.document.write(html); // }); }
Using jsr.render works for 99 rows of data. If I use more data than that I get the "too many parameters PayloadTooLargeError".
If I try jsr.renderAsync I get the following error:2017-12-07T10:53:02.107Z - error: Error during processing request: http://localhost:5488/api/report details: Could not parse report template, aren't you missing content type? undefined
As you can see above in my code I do set the contentType.
Please help. -
RE: getting html from html-with-browser-client
You can make a regular http call with the angular httpClient.
[CODE]
onHttp(){
let url = "http://localhost:5488/api/report"//"https://frail.jsreportonline.net/api/report";
var body ={
"template": { "shortid" : "BJY_QAtgf" }
}let headers = new HttpHeaders().set('Content-type', 'application/json'); this.http.post(url, JSON.stringify(body), {headers: headers, responseType:'text'}).subscribe((resp)=>{ console.log("response:", resp); })
}
[/CODE]