Hi ,
Below is the code I am using it for PrintTask
var url = "https://servername:6443/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20T...";
var printTask = new PrintTask(url);
var params = new PrintParameters();
var template = new PrintTemplate();
template.format = "PDF";
template.layout = "MAP_ONLY";
template.preserveScale = false;
template.layoutOptions = {"legendLayers": [],
"titleText": "Map Print",
"authorText": "AAAAA",
"copyrightText": "BBBBB",
"scalebarUnit": "Kilometers"};
params.map = this.map;
params.template = template;
printTask.execute(params, lang.hitch(this, this._printResult),lang.hitch(this, this._printResultError));
_printResultError:function(err)
{
debugger;
alert(err);
},
_printResult:function(res){
debugger;
window.open(res.url, "_blank")
},
I am getting the following error
"Error executing tool. Export Web Map Task : Layer "ServiceName": Unable to connect to map server at https://servername:6443/arcgis/rest/services/ServiceName/MapServer.
Failed to execute (Export Web Map).
Failed to execute (Export Web Map Task)."
Solved! Go to Solution.
Mohan,
Do you have Web Adaptor installed on your server? If you do then you should be using the web adaptor url and not the "https: //servername:6443/arcgis/rest/services" url. Is that map service secured?
Mohan,
Do you have Web Adaptor installed on your server? If you do then you should be using the web adaptor url and not the "https: //servername:6443/arcgis/rest/services" url. Is that map service secured?
Yes web adaptor was installed . Map service is not secured. Thanks for the help robert its working.