Hello Team,
Am new to jsreport studio, Here i used beforerender() method in this method does't working in local machine. I put my code here for your reference.
html code using handlebars.
<table>
<tr>
<th>Country</th>
<th>Name</th>
<th>abbrivation</th>
<th>Area</th>
<th>Largest_city</th>
<th>capital</th>
</tr>
{{#each stats.RestResponse.result}}
<tr>
<td>{{country}}</td>
<td>{{name}}</td>
<td>{{abbr}}</td>
<td>{{area}}</td>
<td>{{largest_city}}</td>
<td>{{capital}}</td>
</tr>
{{/each}}
</table>
script code:
function beforeRender(done) {
console.log("check-->",JSON.stringify(body));
request.template.content = JSON.stringify(body);
request.data = { stats: body };
done();
});
}
Here i used api. this api does not return any data .
Best & Regards.
SARANRAJ K.R