Dear all,
i have two arcgis server.one is installed on my local machine.Other is on our production server.
Below is my code for print button.
esriConfig.defaults.io.corsDetection = false;
esriConfig.defaults.io.alwaysUseProxy = false;
esriConfig.defaults.io.proxyUrl = "http://machineName/Proxy/proxy.ashx"
var url ='http://MachineNAme/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task';
var printTask = new PrintTask(url);
var template = new PrintTemplate();
template.exportOptions = {width:1000,height:400,dpi: 96};
template.layoutOptions = {
titleText: "Mosques",
scalebarUnit: "Miles",
authorText: "Made by: Esri's JS API Team",
copyrightText: "<copyright info here>",
legendLayers: [],
};
template.format = "PDF";
template.layout = "A3 Landscape";//"A3 Portrait";//"MAP_ONLY";
template.preserveScale = true;
template.showLabels=false;
var params = new PrintParameters();
params.map = map;
params.template = template;
//printTask.execute(params, printResult);
printTask.execute(params).then(printResult, printError);
function printResult(result) {
window.open(result.url, "_blank")
}
function printError(error) {
alert(error);
}
when i use localhost instead of machine name in printtask.it works properly.even in proxy i use domain url of production server.But when i use print task url of production server it throws me error.that is given below.
Error: Unable to complete operation.
at Object.g.load (js.arcgis.com/3.20/init.js:984)
at js.arcgis.com/3.20/init.js:87
at c (js.arcgis.com/3.20/init.js:103)
at d (js.arcgis.com/3.20/init.js:103)
at a.Deferred.resolve.callback (js.arcgis.com/3.20/init.js:105)
at c (js.arcgis.com/3.20/init.js:104)
at d (js.arcgis.com/3.20/init.js:103)
at a.Deferred.resolve.callback (js.arcgis.com/3.20/init.js:105)
at js.arcgis.com/3.20/init.js:92
at n (js.arcgis.com/3.20/init.js:107)
i could not understand.
http://MachineName/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task.
when i press this link.it give me the attached file page.it means network works properly.so why not response came.
or y not my print work for public ip.My arcgis server is on domain network.
Thanks.