Hi, Thank you for quick response.
We are running js report on port "httpsPort": 5488,
This is the code used to generate PDF using JS Report:
"JSREPORT_LIB_PATH":"https://[IP]:5488",
"JSREPORT_LIB_USERNAME":"",
"JSREPORT_LIB_PASSWORD":"",
var url = JSREPORT_LIB_PATH;
var username = JSREPORT_LIB_USERNAME;
var password = JSREPORT_LIB_PASSWORD;
var reportName = "My_Report";
var filePath = GC_RRF_PATH + 'My_Report' + uuid.v4() + '.pdf';
var client = require("jsreport-client")(url, username, password);
client.render({
template: {
name: reportName,
engine: 'jsrender',
recipe: 'phantom-pdf'
},
data: results.waiverValues // data from the database
}, function (err, response) {
if (err) {
return console.error(err);
} else {
response.body(function (body) {
fs.writeFile(filePath, body, function (err) {
if (err) {
console.log(err);
return callback(err);
} else {
callback(null, {
path: filePath
});
}
});
});
}
});