<?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 Template Set Legend Columns Via Javascript API in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/print-template-set-legend-columns-via-javascript/m-p/346615#M32039</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a web application that displays map, based on dynamic layers, and provides basic functionality like zoom\pan, print(pdf export option) etc. Application uses javascript api. Now there is a requirement to show legend in the printed map pdf and also to add custom text and custom image\picture . So i added empty legend, text and picture elements in the templates of A3 , A4 mxds and published them as service. The templates have no data assigned so empty legend.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.Am able to dynamically assign text values via the following lines of code for template&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #2873ee; font-size: 10pt;"&gt; var legendLayer = new esri.tasks.LegendLayer();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #2873ee; font-size: 10pt;"&gt; legendLayer.layerId = "corridor"; // mapservice id&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #2873ee; font-size: 10pt;"&gt;&amp;nbsp; legendLayer.subLayerIds = [0, 1,2,4,5,6,7,8,9,10];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #2873ee; font-size: 10pt;"&gt;var tmplate = new PrintTemplate();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #2873ee; font-size: 10pt;"&gt; &lt;SPAN style="color: #2873ee; font-size: 13.3333px;"&gt;tmplate &lt;/SPAN&gt;.layout = plate.label = ch;\\template &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #2873ee; font-size: 10pt;"&gt; &lt;SPAN style="color: #2873ee; font-size: 13.3333px;"&gt;tmplate &lt;/SPAN&gt;.format = "PDF";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #2873ee; font-size: 10pt;"&gt; &lt;SPAN style="color: #2873ee; font-size: 13.3333px;"&gt;tmplate &lt;/SPAN&gt;.layoutOptions = {&amp;nbsp;&amp;nbsp;&amp;nbsp; legendLayers: [legendLayer],&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; titleText: "test",&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; scalebarUnit: "Miles",&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #2873ee; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; authorText: "author,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; copyrightText: "Copyright © 2016 Flex Pvt Ltd.",&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #2873ee; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; customTextElements: [&amp;nbsp; { Remarks: "test remarks" },&amp;nbsp;&amp;nbsp; { text1: "xyz 123 " } ,&amp;nbsp;&amp;nbsp;&amp;nbsp; { text2: "abc 456" }&amp;nbsp;&amp;nbsp; ]&amp;nbsp; };&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030; font-size: 10pt;"&gt;2.Am not able to assign legend column numbers from code. For example setting no. of columns in legend to 3 or 4 etc or showing legend in horizontal instead of vertical etc. Is this possible to achieve this via code\api? If yes then how?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030; font-size: 10pt;"&gt;3.Am not able to assign Path(UNC etc) for the picture element from the code. I need this as in my case multiple images will be on a folder on server and user wants to select one of them to be shown on the printed page when using print option. So need to set the path dynamically. &lt;SPAN style="color: #303030; font-size: 13.3333px;"&gt;Is this possible to achieve this via code\api?&lt;SPAN style="color: #303030; font-size: 13.3333px;"&gt; If yes then how?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030; font-size: 10pt;"&gt;Thanks in advance for the help\guidance provided&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030; font-size: 10pt;"&gt;regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030; font-size: 10pt;"&gt;Biju &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 May 2016 02:48:47 GMT</pubDate>
    <dc:creator>bijupanicker</dc:creator>
    <dc:date>2016-05-13T02:48:47Z</dc:date>
    <item>
      <title>Print Template Set Legend Columns Via Javascript API</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/print-template-set-legend-columns-via-javascript/m-p/346615#M32039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a web application that displays map, based on dynamic layers, and provides basic functionality like zoom\pan, print(pdf export option) etc. Application uses javascript api. Now there is a requirement to show legend in the printed map pdf and also to add custom text and custom image\picture . So i added empty legend, text and picture elements in the templates of A3 , A4 mxds and published them as service. The templates have no data assigned so empty legend.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.Am able to dynamically assign text values via the following lines of code for template&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #2873ee; font-size: 10pt;"&gt; var legendLayer = new esri.tasks.LegendLayer();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #2873ee; font-size: 10pt;"&gt; legendLayer.layerId = "corridor"; // mapservice id&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #2873ee; font-size: 10pt;"&gt;&amp;nbsp; legendLayer.subLayerIds = [0, 1,2,4,5,6,7,8,9,10];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #2873ee; font-size: 10pt;"&gt;var tmplate = new PrintTemplate();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #2873ee; font-size: 10pt;"&gt; &lt;SPAN style="color: #2873ee; font-size: 13.3333px;"&gt;tmplate &lt;/SPAN&gt;.layout = plate.label = ch;\\template &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #2873ee; font-size: 10pt;"&gt; &lt;SPAN style="color: #2873ee; font-size: 13.3333px;"&gt;tmplate &lt;/SPAN&gt;.format = "PDF";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #2873ee; font-size: 10pt;"&gt; &lt;SPAN style="color: #2873ee; font-size: 13.3333px;"&gt;tmplate &lt;/SPAN&gt;.layoutOptions = {&amp;nbsp;&amp;nbsp;&amp;nbsp; legendLayers: [legendLayer],&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; titleText: "test",&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; scalebarUnit: "Miles",&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #2873ee; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; authorText: "author,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; copyrightText: "Copyright © 2016 Flex Pvt Ltd.",&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #2873ee; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; customTextElements: [&amp;nbsp; { Remarks: "test remarks" },&amp;nbsp;&amp;nbsp; { text1: "xyz 123 " } ,&amp;nbsp;&amp;nbsp;&amp;nbsp; { text2: "abc 456" }&amp;nbsp;&amp;nbsp; ]&amp;nbsp; };&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030; font-size: 10pt;"&gt;2.Am not able to assign legend column numbers from code. For example setting no. of columns in legend to 3 or 4 etc or showing legend in horizontal instead of vertical etc. Is this possible to achieve this via code\api? If yes then how?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030; font-size: 10pt;"&gt;3.Am not able to assign Path(UNC etc) for the picture element from the code. I need this as in my case multiple images will be on a folder on server and user wants to select one of them to be shown on the printed page when using print option. So need to set the path dynamically. &lt;SPAN style="color: #303030; font-size: 13.3333px;"&gt;Is this possible to achieve this via code\api?&lt;SPAN style="color: #303030; font-size: 13.3333px;"&gt; If yes then how?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030; font-size: 10pt;"&gt;Thanks in advance for the help\guidance provided&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030; font-size: 10pt;"&gt;regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030; font-size: 10pt;"&gt;Biju &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 May 2016 02:48:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/print-template-set-legend-columns-via-javascript/m-p/346615#M32039</guid>
      <dc:creator>bijupanicker</dc:creator>
      <dc:date>2016-05-13T02:48:47Z</dc:date>
    </item>
  </channel>
</rss>

