Thank you so much - it is working now!
John Backer
@John Backer
Posts made by John Backer
-
RE: Trying to get an API call to work using JSReport Online
-
RE: Trying to get an API call to work using JSReport Online
ok, I figured that one out - it was my directory structure. I think my last error is:
Mixed Content: The page at '.......' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://jsreportonline.net/sign'. This request has been blocked; the content must be served over HTTPS. Was I supposed to remove the login lines?
-
RE: Trying to get an API call to work using JSReport Online
Thanks, I really appreciate all the help.
I believe I made the changes you indicated, but I'm getting this in the console:
https://qtis.jsreportonline.net/api/report 404 (Not Found)
(anonymous) @ VM292:1
(anonymous) @ jsreport.min.js:2
_renderAsync @ jsreport.min.js:2
renderAsync @ jsreport.min.js:2
generateReport @ TestJSReport.html:123
onclick @ TestJSReport.html:6
TestJSReport.html:139 Error while executing render request -
RE: Trying to get an API call to work using JSReport Online
I cleared by browser cache and added a new user with read access to the template...
Error: Unable to find specified template or user doesnt have permissions to read it: TimeSheet
at module.exports (/usr/src/app/node_modules/jsreport-core/lib/util/createError.js:11:13)
at Reporter.createError (/usr/src/app/node_modules/jsreport-core/lib/reporter.js:332:12)
at AsyncFunction.<anonymous> (/usr/src/app/node_modules/jsreport-templates/lib/templates.js:134:20)It looks like I have a folder of TimeSheet and inside that there is another TimeSheet with all the parts of the project...but it won't let me copy all the components up to the first level...
-
RE: Trying to get an API call to work using JSReport Online
This thread will give all newbies all they need :)
That worked, but when it presented an authentication dialog and I provided my admin credentials from my admin account I get:
Error: Unable to find specified template or user doesnt have permissions to read it: TimeSheet
at module.exports (/usr/src/app/node_modules/jsreport-core/lib/util/createError.js:11:13)
at Reporter.createError (/usr/src/app/node_modules/jsreport-core/lib/reporter.js:332:12)
at AsyncFunction.<anonymous> (/usr/src/app/node_modules/jsreport-templates/lib/templates.js:134:20)I imagine I need to clear my browser cache because it isn't give me a chance to enter new credentials...
-
RE: Trying to get an API call to work using JSReport Online
Ok, getting further, but now I'm getting an error that the $ is undefined...
jsreport.render($("#placeholder"), request); -
RE: Trying to get an API call to work using JSReport Online
The console is saying that jsreport is not defined.
-
RE: Trying to get an API call to work using JSReport Online
Thanks for the feedback. I tried implementing what you suggested, but it still doing the same thing...nothing. How do we debug this?
-
Trying to get an API call to work using JSReport Online
Having trouble understanding what I'm missing here - when I show the page from a subdomain of ours and click the button nothing happens. Is the URL correct - does it always look like this and the template name is used to choose what report is to be ran. Is there any way to authenticate access to the report? Just using same example Json - just trying to get the API call to work. I removed [our-unique-code] to share this publically. Do I need to include some code for "jsreport.render" to work?
Thank you for your time!
'''
<html>
<head></head>
<body>
<input type="button" title="test" onclick="generateReport();" value="Get PDF Report"/>
<div id="placeholder" style="height:900px;"></div>
<script>
jsreport.serverUrl = 'https://[our-unique-code].jsreportonline.net/api/report';
//URL path in which jsreport server runs
/* For the sample purpose, the below JSON can be used. But in real time this data should come from Web API calls */var outputJSON = { "employee": "john", "address": { "streetaddress": "101 E Main Ave", "address2": " ", "citystzip": "Tucson, AZ 85701" }, "employeephone": "(520)360-1217", "employeeemail": "john@zinatt.com", "payperiodending": "10/29/2021", "rows": [{ "day": "Week# 44, Mon 10/18/21", "regularhours": 8, "travel": 100, "expense": 25.00, "casenumber": "John Demo", "total": 425.00 }, { "day": "Week# 44, Tue 10/19/21", "regularhours": 8, "travel": 100, "expense": 25.00, "casenumber": "John Demo", "total": 425.00 }, { "day": "Week# 44, Wed 10/20/21", "regularhours": 8, "travel": 100, "expense": 25.00, "casenumber": "John Demo", "total": 425.00 }, { "day": "Week# 44, Thu 10/21/21", "regularhours": 8, "travel": 100, "expense": 25.00, "casenumber": "John Demo", "total": 425.00 },{ "day": "Week# 44, Fri 10/22/21", "regularhours": 8, "travel": 100, "expense": 25.00, "casenumber": "John Demo", "total": 425.00 }, { "day": "Week# 45, Mon 10/25/21", "regularhours": 8, "travel": 100, "expense": 25.00, "casenumber": "John Demo", "total": 425.00 }, { "day": "Week# 45, Tue 10/26/21", "regularhours": 8, "travel": 100, "expense": 25.00, "casenumber": "John Demo", "total": 425.00 }, { "day": "Week# 45, Wed 10/27/21", "regularhours": 8, "travel": 100, "expense": 25.00, "casenumber": "John Demo", "total": 425.00 }, { "day": "Week# 45, Thu 10/28/21", "regularhours": 8, "travel": 100, "expense": 25.00, "casenumber": "John Demo", "total": 425.00 }, { "day": "Week# 45, Fri 10/29/21", "regularhours": 8, "travel": 100, "expense": 25.00, "casenumber": "John Demo", "total": 425.00 }], "rateperhour": 50.00, "milecost": 0.52, "totalhours": 80, "totaltravel": 800, "totalexpenses":200.00, "totalpay": 4000.00, "travelcost": 416.00, "grandtotal": 4616.00
}
function generateReport() { var request = { template: { name: 'TimeSheet' }, data: outputJSON }; jsreport.render($("#placeholder"), request); // here ”placeholder” is div tag name in html page }
</script>
</body>
</html>
''' -
RE: local copy (which works fine) imported into JSReportOnline - results in errors
Thanks for your help - this got me over that hump!