javascript - Jasper Async Report - Empty, why? -
lets start , firstly parameters specific report exmaple
var config = { url : "http://exmaple.com/jasperserver/rest_v2/reports/reportfolder/examplereport/inputcontrols", method: "get", headers: { accept: "application/json;" }, }
everything ok, response array of inputs,
the array contains, 2 objects :
first:
{ description: "date_from", id: "date_from", label: "date from", type: "singlevaluedate" }
second:
{ description: "date_to", id: "date_to", label: "date_to", type: "singlevaluedate" }
both inputs have property:
validationrules[0].datetimeformatvalidationrule.format = "yyyy-mm-dd"
so want run async report (i pass async parameter false now, se there less code here)
var params ={ reportunituri: "/reportfolder/examplereport", outputformat: "html", freshdata : true, savedatasnapshot : false, ignorepagination: true, async : false, interactive: false, allowinlinescripts: true, parameters: { "date_from":["2014-08-01"], "date_to":["2015-10-08"] } }
so try generate async report:
var config = { url : "http://exmaple.com/jasperserver/rest_v2/reportexecutions", headers: { accept: "application/json" }, data: params, method: "post" }
i success response,
totalpages: 0, requestid: "0200cf28-300f-4e76-b99e-e479be4980ba", reporturi: "/reportfolder/examplereport/", status: "ready", exports[0].id: "c9a5578a-6bc8-4c3e-8a78-9056ef19f456", exports[0].status: "ready", exports[0].outputresource :{ contenttype: "text/html", outputfinal: true }
when try output of report calling :
http://exmaple.com/jasperserver/rest_v2/reportexecutions/0200cf28-300f-4e76-b99e-e479be4980ba/exports/c9a5578a-6bc8-4c3e-8a78-9056ef19f456/outputresource
the report empty.
runing same via :
http://exmaple.com/jasperserver/rest_v2/reports/reportfolder/examplereport.html?date_from=2014-08-01&date_to=2015-09-08
gives me filled report,
can point me i'm doing wrong ? :/ i'm pretty sure may wrong parameters tried in various ways , can't find solution myself :/
the thing parameters passed async report badly formatted, should this:
parameters: { reportparameter: [ {name : "date_from",value : ["2014-08-01"]}, {name : "date_to",value : ["2015-10-08"]} ] }
Comments
Post a Comment