<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Print Tool not working in WAB 2.6 in ArcGIS Web AppBuilder Questions</title>
    <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/print-tool-not-working-in-wab-2-6/m-p/243396#M6542</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to print map using the below code-&lt;/P&gt;&lt;P&gt;&lt;EM&gt; var legendLayer = new LegendLayer();&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; legendLayer.layerId = this.map.layerIds[1];&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; legendLayer.subLayerIds = [0,1];&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; // legendLayer.subLayerIds = [1];&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;SPAN&gt; var url = "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2FMachineName%3A6443%2Farcgis%2Frest%2Fservices%2FUtilities%2FPrintingTools%2FGPServer%2FExport%2520Web%2520Map%2520Task" rel="nofollow" target="_blank"&gt;https://MachineName:6443/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task&lt;/A&gt;&lt;SPAN&gt;";&lt;/SPAN&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; var printTask = new PrintTask(url);&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; var params = new PrintParameters();&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; var template = new PrintTemplate();&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; template.format = "PDF";&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; template.layout = "A4 Landscape";&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; template.layoutOptions = {"legendLayers": [legendLayer], // empty array means no legend&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; "titleText": "Map Print",&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; "authorText": "Insight",&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; "copyrightText": "LTI",&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; "scalebarUnit": "Kilometers"};&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; template.preserveScale = false;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; debugger; &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; template.exportOptions = {&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; width:30,&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; height:60,&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; dpi:96&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; };&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; params.map = this.map;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; params.template = template;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; printTask.on("error",lang.hitch(this, this._printResultError));&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; printTask.execute(params, lang.hitch(this, this._printResult));&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;}&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;The above code works fine in for WAB 2.5 using ArcGIS JavaScript API 3.21 with dynamic Map service Layer as a basemap. Please find below image for the same without any error any console window&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="399930" alt="Success" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/399930_Get.png" style="width: 620px; height: 348px;" /&gt;&lt;/P&gt;&lt;P&gt;Whereas same code, with&amp;nbsp;&lt;SPAN&gt;WAB 2.6 using ArcGIS JavaScript&amp;nbsp;API 3.22 with tiled&amp;nbsp; map service as a basemap is not working.Please find image below&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;IMG __jive_id="399931" alt="Error" class="image-2 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/399931_post.png" style="width: 620px; height: 348px;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I found that the request for WAB 2.5&amp;nbsp;serves&amp;nbsp;GET request, whereas WAB 2.6 serves POST request by default. Also when i check server manager logs it s saying "error 000735: web map as JSON:Value is required". Please find below image-&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;IMG __jive_id="399935" alt="ArcGIS Server Manage logs" class="image-3 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/399935_Logs.png" style="width: 620px; height: 182px;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;How to resolve this issue??&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Shaikh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Mar 2018 14:48:00 GMT</pubDate>
    <dc:creator>ShaikhRizuan</dc:creator>
    <dc:date>2018-03-27T14:48:00Z</dc:date>
    <item>
      <title>Print Tool not working in WAB 2.6</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/print-tool-not-working-in-wab-2-6/m-p/243396#M6542</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to print map using the below code-&lt;/P&gt;&lt;P&gt;&lt;EM&gt; var legendLayer = new LegendLayer();&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; legendLayer.layerId = this.map.layerIds[1];&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; legendLayer.subLayerIds = [0,1];&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; // legendLayer.subLayerIds = [1];&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;SPAN&gt; var url = "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2FMachineName%3A6443%2Farcgis%2Frest%2Fservices%2FUtilities%2FPrintingTools%2FGPServer%2FExport%2520Web%2520Map%2520Task" rel="nofollow" target="_blank"&gt;https://MachineName:6443/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task&lt;/A&gt;&lt;SPAN&gt;";&lt;/SPAN&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; var printTask = new PrintTask(url);&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; var params = new PrintParameters();&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; var template = new PrintTemplate();&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; template.format = "PDF";&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; template.layout = "A4 Landscape";&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; template.layoutOptions = {"legendLayers": [legendLayer], // empty array means no legend&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; "titleText": "Map Print",&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; "authorText": "Insight",&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; "copyrightText": "LTI",&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; "scalebarUnit": "Kilometers"};&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; template.preserveScale = false;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; debugger; &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; template.exportOptions = {&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; width:30,&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; height:60,&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; dpi:96&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; };&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; params.map = this.map;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; params.template = template;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; printTask.on("error",lang.hitch(this, this._printResultError));&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; printTask.execute(params, lang.hitch(this, this._printResult));&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;}&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;The above code works fine in for WAB 2.5 using ArcGIS JavaScript API 3.21 with dynamic Map service Layer as a basemap. Please find below image for the same without any error any console window&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="399930" alt="Success" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/399930_Get.png" style="width: 620px; height: 348px;" /&gt;&lt;/P&gt;&lt;P&gt;Whereas same code, with&amp;nbsp;&lt;SPAN&gt;WAB 2.6 using ArcGIS JavaScript&amp;nbsp;API 3.22 with tiled&amp;nbsp; map service as a basemap is not working.Please find image below&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;IMG __jive_id="399931" alt="Error" class="image-2 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/399931_post.png" style="width: 620px; height: 348px;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I found that the request for WAB 2.5&amp;nbsp;serves&amp;nbsp;GET request, whereas WAB 2.6 serves POST request by default. Also when i check server manager logs it s saying "error 000735: web map as JSON:Value is required". Please find below image-&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;IMG __jive_id="399935" alt="ArcGIS Server Manage logs" class="image-3 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/399935_Logs.png" style="width: 620px; height: 182px;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;How to resolve this issue??&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Shaikh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Mar 2018 14:48:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/print-tool-not-working-in-wab-2-6/m-p/243396#M6542</guid>
      <dc:creator>ShaikhRizuan</dc:creator>
      <dc:date>2018-03-27T14:48:00Z</dc:date>
    </item>
  </channel>
</rss>

