Well, solved it myself :P
Somehow the jsreport template was messed up. I made another template by copy-paste and got a new shortid, that worked. It might be because copying templates between servers doesn't work.
A
Posts made by ascsi
-
RE: Strange 404 error
-
Strange 404 error
I get a strange 404 error (not found). It works only sometimes
members call does not work, member call does using the same url and subroutine to call jsreportMy request ...
nav.factory("Report", function($http, $uibModal, global) {
var req = { method: 'POST', url: global.reportUrl + "/api/report", headers: { 'Content-Type': 'application/json' }, data : { "template" : { "shortid" : "x" }, "data" : { "name" : global.club.name, "user" : global.user.id, "unit" : global.user.unit }, "options": { "debug": { "logsToResponse": true, "logsToResponseHeader": true }, "reports": { "save": true }, "language": "da" } } } function jsreportCall(req){ $http(req) .then(response => { var uib = $uibModal.open({ animation : true, templateUrl : "src/templates/print.html", controller : "printController", controlleras : "printController", resolve : { jsreport : response } }); uib.result.then(function(returnValue) { }); }) .catch(errorpayload => { console.log(errorpayload.data); }); } return { members : function(data) { req["data"]["template"]["shortid"] = "H1V8aL5I-"; req["data"]["data"]["members"] = data; jsreportCall(req); }, member : function(number) { req["data"]["template"]["shortid"] = "BykieHo8b"; req["data"]["data"]["number"] = number; jsreportCall(req); } };
});