I have patient data in my databases represented in HTML that I want to print as an excel sheet using JSReport. But when I get the response from the jsreport server with the recipe it reads jibberish and I can't find a way to render it into an excel file.
Dummy example
const axios = require("axios");
const url = "http://localhost:5488/api/report/";
const data = {
"template": {
"shortid": "2_Kw0BRuOm",
"recipe": "html-to-xlsx",
"data": {
"people": [
{
"name": "Omar rafat",
"age": "20",
"job": "Software Engineer"
}
]
}
}
}
axios.post(url, {
"template": {
"shortid": "2_Kw0BRuOm",
"recipe": "html-to-xlsx",
"data": {
"people": [
{
"name": "Omar rafat",
"age": "20",
"job": "Software Engineer"
}
]
},
"options": { "reports": { "save": true } }
}
}).then(res => console.log(res.data)).catch(err => console.log(err));
Raw html-to-xlsx response
I might have missed up on the library's usage due to my misunderstanding of how the technology works but I really hope some of you might guide me on the correct implementation of it.
Thanks.
