Worked great. Thank you Jan.
derobiom
@derobiom
Posts made by derobiom
-
RE: I'm receiving a 502 / Bad Gateway response ONLY when I add a header to my phantom-pdf report
-
I'm receiving a 502 / Bad Gateway response ONLY when I add a header to my phantom-pdf report
I'm receiving a 502 / Bad Gateway response ONLY when I add a header to my phantom-pdf report:
Unable to render template. <html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx/1.13.8</center>
</body>
</html>I'm using the jsreport.Client v2.0.2 / ReportingService.RenderAsync(string templateShortid, string jsonData, null) to make the call. I'm making the call from ASP.NET Core 2.1 running on the full .NET Framework 4.7.
Without the header in phantom-pdf, the call works fine. When I add the header in jsreport studio, the call works great. But when I call it from my server, I receive the bad gateway response.
Here is my log from a call where I received that bad gateway error:
+0 Starting rendering request 54278
+4 Rendering template {shortid:SkhDhiX0G, recipe:phantom-pdf,engine:handlebars}
+6 Inline data specified.
+11 Executing script H1xyvW55Ae
+77 Resources not defined for this template.
+80 Rendering engine handlebars
+92 Compiled template not found in the cache, compiling
+101 Replaced images []
+101 Executing recipe phantom-pdf
+102 Starting child request to render pdf header
+106 Starting rendering request 54279
+110 Rendering template {shortid:SkhDhiX0G, recipe:html,engine:handlebars}
+111 Inline data specified.
+116 Executing script H1xyvW55Ae
+134 Resources not defined for this template.
+139 Rendering engine handlebars
+162 Taking compiled template from engine cache
+164 Replaced images []
+165 Executing recipe html
+165 Skipping storing report.
+166 Rendering request finished 54279
+176 Rendering request 54279 finished in 37 ms
+178 Starting child request to render pdf footer
+182 Starting rendering request 54280
+185 Rendering template {shortid:SkhDhiX0G, recipe:html,engine:handlebars}
+186 Inline data specified.
+191 Executing script H1xyvW55Ae
+208 Resources not defined for this template.
+211 Rendering engine handlebars
+239 Taking compiled template from engine cache
+359 Replaced images []
+360 Executing recipe html
+360 Skipping storing report.
+361 Rendering request finished 54280
+367 Rendering request 54280 finished in 155 ms
+473 Converting in http server based phantomjs 1.9.8
+474 Request file:///%2Ftmp%2Fe3691040-58f7-11e8-b6be-fb387c609d7fhtml.html
+575 phantom-pdf recipe finished with 4 pages generated
+576 Skipping storing report.This is the log from a call when the phantom-pdf header is not present and the call returned successfully:
+0 Starting rendering request 326882
+5 Rendering template {shortid:SkhDhiX0G, recipe:phantom-pdf,engine:handlebars}
+6 Inline data specified.
+12 Executing script H1xyvW55Ae
+66 Resources not defined for this template.
+76 Rendering engine handlebars
+667 Compiled template not found in the cache, compiling
+758 Replaced images []
+759 Executing recipe phantom-pdf
+760 Starting child request to render pdf footer
+771 Starting rendering request 326883
+784 Rendering template {shortid:SkhDhiX0G, recipe:html,engine:handlebars}
+786 Inline data specified.
+792 Executing script H1xyvW55Ae
+850 Resources not defined for this template.
+860 Rendering engine handlebars
+879 Compiled template not found in the cache, compiling
+883 Replaced images []
+884 Executing recipe html
+884 Skipping storing report.
+885 Rendering request finished 326883
+891 Rendering request 326883 finished in 36 ms
+1752 Converting in http server based phantomjs 1.9.8
+1753 Request file:///%2Ftmp%2Ff94f60b0-58f9-11e8-8a39-f15f3d321df0html.html
+1868 phantom-pdf recipe finished with 4 pages generated
+1869 Skipping storing report.These are the addition log elements from the call when there is a header. I don't see anything interesting here.
+102 Starting child request to render pdf header
+106 Starting rendering request 54279
+110 Rendering template {shortid:SkhDhiX0G, recipe:html,engine:handlebars}
+111 Inline data specified.
+116 Executing script H1xyvW55Ae
+134 Resources not defined for this template.
+139 Rendering engine handlebars
+162 Taking compiled template from engine cache
+164 Replaced images []
+165 Executing recipe html
+165 Skipping storing report.
+166 Rendering request finished 54279
+176 Rendering request 54279 finished in 37 ms -
RE: table management features (UI)
I am trying to do this very same thing. I am trying to use datatables.js. I believe that it is possible but I can't find an example.
-
RE: Looking for Interactive html Datagrid example
Is there an example of rendering some of the html on the client?
-
RE: Looking for Interactive html Datagrid example
Without some examples I'm really lost. For example, the below code renders great in the jsreport studio as handlebars/html. However, when I call it from my app, the document.ready is treated as text by the browser and displayed on screen. Even if it were treated as a script, dataTables.js is not present to call on the client...at least I don't think so. I tried to just use the html-with-browser-client as my recipe and it simply renders the html table and then spewed gibberish (i.e. "jsreport.serverUrl='https://moyesco.jsreportonline.net';jsreport.template=JSON.parse(decodeURIComponent("%7B%22_i..."). I suppose that I need the jsreport client JavaScript in my browser client...or at least I think so?
I guess that I am really having a hard time understanding server side rendering with dynamic content. I'm not sure what should happen where and why.
=====================================================
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.15/css/jquery.dataTables.min.css">
<script src='https://code.jquery.com/jquery-1.12.4.js'></script>
<script src='https://cdn.datatables.net/1.10.15/js/jquery.dataTables.min.js'></script>
</head><body>
<table id="example" class="display" cellspacing="0" width="100%">
<thead>
<tr>
<th>Country</th>
<th>Company</th>
<th>Website</th>
<th>Interests</th>
</tr>
</thead>
<tbody>
{{#each rows}}
<tr>
<td>{{countryname}}</td>
<td>{{company}}</td>
<td> {{#if website}}<a href="{{website}}">website</a>{{/if}}</td>
<td>{{interests}}</td>
</tr>
{{/each}}
</tbody>
</table>
</body><script>
$(document).ready(function() {
$('#example').DataTable();
} );
</script></html>
-
Looking for Interactive html Datagrid example
I'm currently returning data as a html table. The client wants a nice looking grid with sortable columns. I would not be surprised is paging were next as some results can have many rows. Is there an example of a simple datagrid used with jsreport? I'd like to stick with sending the json up to jsreport online rather thann having the report make an api call. I hope that makes sense, but maybe not. I guess I really would like to see some examples of different approaches to this problem.