I have a nodejs app and I want to get a report (PDF format) from my Jaspersoft server using the REST API
this is my code:
axios.get("http://localhost:8080/jasperserver/rest_v2/resources/reports/Report/test", {
params: {
j_username: "jasperadmin", j_password: "jasperadmin"
}
})
.then(function (response) {
// handle success
console.log("getReport response: ",response.data);
resolve(response.data);
})
.catch(function (error) {
// handle error
console.log("getReport erreur ",error.message);
reject({
status: 201,
timestamp: new Date().getTime(),
message: "Erreur lors de l'execution",
success: false,
});
})
.finally(function () {
// always executed
});
I got a succeful response but the data looks like an object with only metadata, I cannot get the PDF file
I found the solution while reading the JasperReports Server Web Service Guide
Hope it helps