AnsweredAssumed Answered

Print dijit, CORS error

Question asked by xylochic627 on Aug 20, 2015
Latest reply on Aug 28, 2015 by Yusufamro

I am having a very similar issue as is mentioned here: I've added in Print dijit and PrintTemplate task and get a print button. However, when I click it, it changes from Print to Printing, runs for a bit, then changes back to Print. When I check the Firefox developer tools, I get this error:


I've added in a proxy on my server and gone through the steps to enable CORS mentioned at enable cross-origin resource sharing. I'm still getting the error.


At this point, I'm not sure if it is an issue in my code, or that I need to place the proxy on my local machine, where I'm building. I can't turn on IIS on my local machine, as our IT folks don't allow it.


Here's the code I added in for printing and the proxy: = "http://myURL/DotNet/proxy.ashx", = false;

//Create Printer Layouts Array
var myLayouts = [{
"name": "Print_Landscape",
"label": "Letter (Landscape Orientation)",
"format": "pdf"
}, {
"name": "Print_Portrait",
"label": "Letter (Portrait Orientation)",
"format": "pdf"

//Create Print Templates
var myTemplates = [];
dojo.forEach(myLayouts, function (lo) {
var printTemp = new PrintTemplate();
  printTemp.layout =;
  printTemp.label = lo.label;
  printTemp.format = lo.format


And this portion after creation of my map:


//Add Print Widget

var PrintWidget = new Print({

map: mapMain,

url: "https://myURL/rest/services/CustomPrint/GPServer/Export%20Web%20Map",

templates: myTemplates

}, "PrintWidg");



Any help/guidance would be much appreciated! Thank you in advance!