I have to use the ArcGIS API for JavaScript to show a PDF report, I'm using that API because the report is created from my ArcGIS server, this is my scenario.
JS Code:
function printReport(){
var printTask = new PrintTask({
url: ptReport,
mode: "async"
})
var template = new PrintTemplate({
format: "pdf",
exportOptions: {
dpi: 96
},
outputSize:[800, 1100],
layout: "",
layoutOptions: {
titleText: "",
authorText: ""
}
});
var params = new PrintParameters({
view: view,
template: template,
extraParameters: {
"pPerdidaCablesConectores" : "1 dB",
"pOtrasPerdidas" : "0 dB"
}
});
printTask.execute(params).then(sendRequestPrint, showError);
}
function sendRequestPrint(data){
console.log(data.value); //it always is void
}
When I run the printReport method it work fine,in fact, the report is created in the server, I know it because I'm analysing the responses that come from the ArcGIS server:
All work fine at this point, however, when the sendRequestPrint method is runned, the response always come void.
What's happening, why whether the report is created it doesn't come in the response?