AnsweredAssumed Answered

Print Dijit not opening up new tab when job is complete

Question asked by JordanBaumgardner_GIS on Feb 3, 2016
Latest reply on Feb 4, 2016 by JordanBaumgardner_GIS

Of course everything works great on our dev servers but when we deploy to the clients servers the resulting print job does not automatically open in a new tab. The return Json from our Dev server looks identical to the return json from the client

 

-- ours

  {

    "paramName": "Output_File",

    "dataType": "GPDataFile",

    "value": {

      "url": "http://machineNameDev/arcgis/rest/directories/arcgisjobs/utilities/printingtools_gpserver/j2a6ac286e0d64525ba713beb1e1d9869/scratch/473e76e777c646a28ec7c9251c8b3011.png"

    }

  }

-- vs theirs

  {

    "paramName": "Output_File",

    "dataType": "GPDataFile",

    "value": {

      "url": "http://machineName/arcgis/rest/directories/arcgisjobs/abcdefg/printvectormap_gpserver/j745b8bd480aa42ef8db5d652a460d049/scratch/WebMap_96218500-caa2-11e5-9d02-005056b13d26.PDF"

    }

  }

 

I though perhaps security on the browser was not allowing popups so I added

 

var win = window.open("http://machineName/arcgis/rest/directories/arcgisjobs/abcdefg/printvectormap_gpserver/j745b8bd480aa42ef8db5d652a460d049/… ", '_blank');
win.focus();

and that was able to open the tab and link w/o issue.

 

 

My Code:

 

                var prntTemplate = new esriPrintTemplate();
                prntTemplate.layout = $('#printLayout').val();
                prntTemplate.format = $('#printFormat').val();
                prntTemplate.layoutOptions = {
                    "legendLayers": []
                };

                me.esriPrintTool = new esriPrint({
                    async: true,
                    map: mainmap,
                    "templates": prntTemplate,
                    url: me.getPrintUrl("AdvancedPrint")
                }, dojoDom.byId("hiddenPrintBtnDiv"));


                me.esriPrintTool.on("error", function (evt) {
                    me.LogError("OnPrintTool Advanced Error", evt);
                });
                me.esriPrintTool.on("print-complete", function (evt) {
                    toastr["info"]("Print Complete", "Advanced Print");
                    $('#btnAdvancedPrint').removeClass("active").val("Print");
                    me.onPrintComplete();
                });


                me.esriPrintTool.startup();
                me.esriPrintTool.hide();
                me.esriPrintTool.printMap(prntTemplate);


Outcomes