HI bjimatos am trying same process on another machine the download reports in excel and pdf format for jsreport studio. Here the recipe is having in jsreport studio "html-with-browser-client" if i changed to "html" i got the error for jsreport is not defined. As you told for this fix to change recipe. i tried in another machine that the reports are not download in jsreport studio it throws undefined error how to fix this problem.
Posts made by saranilangoRasu
-
RE: ReferenceError: jsreport is not defined
-
RE: how to show the ajax response(reports) in Excel format each object in each cell
Am using third party API to get my reports in jsreport studio script section.
the code is :var http = require('http');
function beforeRender(req, res, done) {
require('request')({
url:"your_API",
json:true
}, function(err, response, body){
req.data.posts = body;
done();
});
} -
jsreport methods got undefined on angular application.
I have used the reports in jsreport studio from my application, In this report i download pdf and excel format jsreport studio, this template i used in my application while download pdf and excel format the methods got undefined.
The jsreport studio code is:
<button onclick="printExcel()" style="width: 200px" class="small-button button loading-pulse lighten success">
Download Excel Report
</button>
<button onclick="printPdf()" style="width: 200px" class="small-button button loading-pulse lighten primary">
Download pdf Report
</button>the script code is:
function printExcel() {
var blob = new Blob([document.getElementById('testform').innerHTML], {
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;"
});
saveAs(blob, "Report.xls");
}
function printPdf() {
var myJSON = JSON.stringify(jsreport.data.posts);
var blob = new Blob([myJSON], {
type: "application/pdf"
});
var pdf = new jsPDF();
pdf.addHTML(($("#pdfContent")[0]), { pagesplit: true }, function () {
pdf.save('NovusReport' + '.pdf');
});
}In this code have two methods got undefined while using my application via API.
![alt text]( image url)
here all the jsreport script method is comes in my application but i don't know why it got undefined .
-
RE: how to show the ajax response(reports) in Excel format each object in each cell
the jsreport.data having the following data
{
"Facility": "PD Prototype Medical Center (Bridge)",
"Report_Type": "Discharge Medication Instructions",
"Time": "Jul 12, 2017 02:12AM",
"Name": "A,Yogesh Kannan,III",
"MRN": "4285",
"VN": "2643",
"DOB": "06/05/1993",
"Age": "24 years",
"Ht": "",
"Gender": "Male",
"Wt": "",
"BSA": "",
"Medication": "",
"FOod": " BSR",
"Sub": "",
"Latex": "",
"Discharge_Meds": [{
"Name": "Diflucan (Fluconazole)",
"Direction": "100 mg tab by mouth Wednesday, 7 December 2016",
"Next_Dose": "",
"Reason": "",
"Product": "Diflucan Oral Tablet 100 MG",
"Reason_Not_Continued": "",
"Comment": "",
"Quantity": "",
"Refills": "0",
"Status": "(Stop)"
},
{
"Name": "Aspirin",
"Direction": "",
"Next_Dose": "",
"Reason": "",
"Product": "Aspirin Powder",
"Reason_Not_Continued": "",
"Comment": "",
"Quantity": "1 capsule",
"Refills": "0",
"Status": "(Changed)"
},
{
"Name": "Aspirin",
"Direction": "1 mg by mouth three (3) times per day",
"Next_Dose": "",
"Reason": "",
"Product": "Aspirin Oral Tablet 325 MG",
"Reason_Not_Continued": "",
"Comment": "",
"Quantity": "0",
"Refills": "0",
"Status": "(Changed)"
},
{
"Name": "Ibuprofen",
"Direction": "200 mg by mouth three (3) times per day as needed",
"Next_Dose": "",
"Reason": "",
"Product": "",
"Reason_Not_Continued": "",
"Comment": "",
"Quantity": "0",
"Refills": "0",
"Status": "(Continued)"
},
{
"Name": "Glimepiride",
"Direction": "4 mg by mouth daily",
"Next_Dose": "",
"Reason": "",
"Product": "",
"Reason_Not_Continued": "",
"Comment": "",
"Quantity": "0",
"Refills": "0",
"Status": "(New)"
},
{
"Name": "Rx: Compazine (PO/IV/IM/PR) (Prochlorperazine (PO/IM/IV/PR))",
"Direction": "strength/unit ___ two (2) times per day",
"Next_Dose": "",
"Reason": "",
"Product": "",
"Reason_Not_Continued": "",
"Comment": "",
"Quantity": "0",
"Refills": "0",
"Status": "(New)"
}]
} -
how to show the ajax response(reports) in Excel format each object in each cell
Here i have working on download the reports in Excel and pdf format, i need to display the each object in each cell in excel.
code is :
<button onclick="printExcel()" style="width: 200px" class="small-button button loading-pulse lighten success">
Download Excel Report
</button><script>
function printExcel() {
console.log("jsreport.data--->",jsreport.data.posts);
var myJSON = JSON.stringify(jsreport.data.posts);
console.log("jsreport.myJSON-->",myJSON)
var blob = new Blob([myJSON], {
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;"
});
saveAs(blob, "Report.xls");
}
</script> -
RE: ReferenceError: jsreport is not defined
Hi bjrmatos, am getting same error after the recipe is changed to html, the error is "Uncaught ReferenceError: jsreport is not defined: @ http://localhost:9000/novus#!/visit/VWJ3S3Q0VEFPWVlxTk9wcHJkWmpOZy0t/meds/1/medlist:37" can you help?
-
RE: ReferenceError: jsreport is not defined
here the interactive report 1 is the report was download pdf and excel format, in script shortid is "SJ7JVjh4W"
-
RE: ReferenceError: jsreport is not defined
i used only API on my nodejs application. the pdf or excel was download fine in jsreport studio, in will not come on node.js application.
for your reference my script code is :
self.getJsReport = function (report) { var req; switch (report) { case 'report1': req = { method: 'POST', url: 'http://localhost:4000/api/report', "async": true, "crossDomain": true, "headers": { "content-type": "application/json", "cache-control": "no-cache" }, "processData": false, "data": "{\"template\":{\"shortid\":\"H1RO-jhVb\"},\"data\":{\"aProperty\":\"value\"}}" } break; case 'report2': req = { method: 'POST', url: 'http://localhost:4000/api/report', "async": true, "crossDomain": true, "headers": { "content-type": "application/json", "cache-control": "no-cache" }, "processData": false, "data": "{\"template\":{\"shortid\":\"Hyoh-s3NW\"},\"data\":{\"aProperty\":\"value\"}}" } break; case 'report3': req = { "async": true, "crossDomain": true, "url": "http://localhost:4000/api/report", "method": "POST", "headers": { "content-type": "application/json", "cache-control": "no-cache" }, "processData": false, "data": "{\"template\":{\"shortid\":\"SJ7JVjh4W\"},\"data\":{\"aProperty\":\"value\"}}" } break; } $http(req).then(function(data){ self.writetodiv(data.data,report); }, function(){ });
The html code is:
</uib-accordion-group> <li><a data-ng-click="e.getJsReport('report1')">Report 1</a></li> <li><a data-ng-click="e.getJsReport('report2')">Report 2</a></li> <li><a data-ng-click="e.getJsReport('report3')">Interactive Report 1</a></li> </uib-accordion>
-
RE: ReferenceError: jsreport is not defined
yes thank you, but report not download the pdf or Excel format i got the following error "An error has accrued Script error.: @ :0" how could i fix this problem?
-
ReferenceError: jsreport is not defined
Here i used the jsreport in my nodejs application while download the report in pdf or Excel format i got this error, but all the dependencies are having in my application under jsreport folder
-
Error during rendering report: Cannot read property 'forEach' of undefined
I have generated the phantom-pdf in jsreport. i tried in report api in postman i got the error is "Error during rendering report: Cannot read property 'forEach' of undefined"
The url : http://localhost:3000/api/report
Content-Type: application/json
{"template":{"shortid":"rkJTnK2ce"},"data":{"aProperty":"value"}}the details error message.
{"message":"Error during rendering report: Cannot read property 'forEach' of undefined","stack":"TypeError: Cannot read property 'forEach' of undefined\n at Object.total (evalmachine.:13:10)\n at Object.eval [as main] (eval at createFunctionContext (C:\SARANRAJ K.R\Medrec\meds_6.2.0\node_modules\jsreport-handlebars\node_modules\handlebars\dist\cjs\handlebars\compiler\javascript-compiler.js:254:23), :26:68)\n at main (C:\SARANRAJ K.R\Medrec\meds_6.2.0\node_modules\jsreport-handlebars\node_modules\handlebars\dist\cjs\handlebars\runtime.js:173:32)\n at ret (C:\SARANRAJ K.R\Medrec\meds_6.2.0\node_modules\jsreport-handlebars\node_modules\handlebars\dist\cjs\handlebars\runtime.js:176:12)\n at ret (C:\SARANRAJ K.R\Medrec\meds_6.2.0\node_modules\jsreport-handlebars\node_modules\handlebars\dist\cjs\handlebars\compiler\compiler.js:525:21)\n at C:\SARANRAJ K.R\Medrec\meds_6.2.0\node_modules\jsreport-handlebars\lib\handlebarsEngine.js:25:14\n at evalmachine.:1:41\n at ContextifyScript.Script.runInContext (vm.js:37:29)\n at ContextifyScript.Script.runInNewContext (vm.js:43:15)\n at Object.exports.runInNewContext (vm.js:74:17)"}
-
RE: Graph is not displaying in Node Js Application.
https://github.com/jsreport/jsreport/issues/190
i got help form above link. now working fine.
And in jsreport studio recipe must be a "html".
-
RE: Graph is not displaying in Node Js Application.
some one help me i was stuck this issue
-
Graph is not displaying in Node Js Application.
I'm new to jsReport , i used existing jsreport with ChartJs in local jsreport server in my node application its working fine showing html data with bar chart in jsreport studio, but if i tried to access this report template from angularjs with nodejs application i get only HTML table data but it not showing chart in my application. Please help me out on this, Thanks in advance.
But not showing in Nodejs application
-
message":"Could not parse report template, aren't you missing content type?
i try to get the jsreport studio template report in my nodejs application but i can not able to get the details through api while i trying i got this error "message":"Could not parse report template, aren't you missing content type? '''
then i fount some help from here "https://groups.google.com/forum/#!searchin/jsreport/message"$3A"Could$20not$20parse$20report$20template$2C$20aren$27t$20you$20missing$20content$20type$3F|sort:relevance/jsreport/DMm02ZtwDLM/zhYUnr_tAAAJ"
but
it
not
working
the
code
is
data: JSON.stringify({
"template": { "shortid" : "EkRWTuKil" },
"data": { "aProperty": "value" }
}) -
RE: Error during rendering report: Data entry not found (BkG5hq6bb)
i can't able to add DataProperties.js in local machine. i got following error "Request has been terminated Possible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc."
-
RE: Error during rendering report: Data entry not found (BkG5hq6bb)
that file to add in my local?
-
Error during rendering report: Data entry not found (BkG5hq6bb)
Error occured - Error during rendering report: Data entry not found (BkG5hq6bb)
Stak - Error: Data entry not found (BkG5hq6bb)
at C:\SARANRAJ K.R\Medrec\meds_6.2.0\node_modules\jsreport-data\lib\data.js:87:15
at tryCatcher (C:\SARANRAJ K.R\Medrec\meds_6.2.0\node_modules\listener-collection\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (C:\SARANRAJ K.R\Medrec\meds_6.2.0\node_modules\listener-collection\node_modules\bluebird\js\release\promise.js:510:31)
at Promise._settlePromise (C:\SARANRAJ K.R\Medrec\meds_6.2.0\node_modules\listener-collection\node_modules\bluebird\js\release\promise.js:567:18)
at Promise._settlePromise0 (C:\SARANRAJ K.R\Medrec\meds_6.2.0\node_modules\listener-collection\node_modules\bluebird\js\release\promise.js:612:10)
at Promise._settlePromises (C:\SARANRAJ K.R\Medrec\meds_6.2.0\node_modules\listener-collection\node_modules\bluebird\js\release\promise.js:691:18)
at Async._drainQueue (C:\SARANRAJ K.R\Medrec\meds_6.2.0\node_modules\listener-collection\node_modules\bluebird\js\release\async.js:133:16)
at Async._drainQueues (C:\SARANRAJ K.R\Medrec\meds_6.2.0\node_modules\listener-collection\node_modules\bluebird\js\release\async.js:143:10)
at Immediate.Async.drainQueues (C:\SARANRAJ K.R\Medrec\meds_6.2.0\node_modules\listener-collection\node_modules\bluebird\js\release\async.js:17:14)
at runCallback (timers.js:651:20)
at tryOnImmediate (timers.js:624:5)
at processImmediate [as _immediateCallback] (timers.js:596:5)while i try to generate livedashboard report i got above error, here i did not use data.js