Oooppps I'm sorry I overlooked that one, Thank you so much @bjrmatos for helping me! it is now working
Posts made by cdaliwan15
-
RE: jsreport-studio preview
-
RE: jsreport-studio preview
Here's my code below
const headers = {
'responseType': 'arraybuffer',
'Content-Type': 'application/json',
'Accept': 'application/pdf'
}await axios.post('http://localhost/api/report', {
"template": {
"name":"demo",
"recipe":"chrome-pdf",
"engine":"handlebars",
"content":"<html> <body> <p> hello world </p> </body> </html>",
}
}, {
headers: {headers}
}).then((response) => {
let rptSrc = URL.createObjectURL(
new window.File([response.data], 'demo.pdf', {
type: 'application/pdf'
})
)
let reportFile = {
filename: 'demo.pdf',
rawData: [response.data],
contentType: 'application/pdf'
}
Studio.preview({
id: uid,
type: 'report',
data: {
template: {
name: 'MYTemplate',
shortid: shortid.generate()
},
reportSrc: rptSrc,
reportFile: reportFile
}
})
}) -
RE: jsreport-studio preview
Hi @bjrmatos, Thank you so much for your help! preview panel is now showing however the data does not show on the page, it's only shows blank page. please help me to show the data on preview
-
RE: jsreport-studio preview
Yes I do the rendering from the backend using this code below then once rendered I want to preview the report on the jsreport-studio (like the normal way when you click run)
*This code just generate the report on the location C:\Users\AppData\Local\Temp\jsreport\autocleanup*
axios.post('http://localhost/api/report', {
"template": {
"name":"demo",
"recipe":"chrome-pdf",
"engine":"handlebars",
"content":"<html> <body> <h1> Sample </h1> </body> </html>",
}
}) -
RE: jsreport-studio preview
I'm creating a template (json format) on the backend that eventually get previewed on the js-report studio. I wanted to know what are the parameter format to be passed on the Preview API. It would be great if you could show me a sample code to preview a template using js report template
on the documentation: Studio.Preview(params)
-
jsreport-studio preview
Please help me.
I have successfully generated the pdf file however I don't know how can I preview it on the js-report studio
I checked the API documentation it says I should use Studio.Preview(param) but I don't know what should I pass inside of the studio preview.
Please provide an example, preferrably a source code.