How-to guide on adding selected parcel information to the Print Service for a WAB application. Thanks Robert
James,
Sure find it attached.
The first part of this is following the tutorial for creating a custom print service:
Tutorial: Publishing additional services for printing—Documentation (10.3 and 10.3.1) | ArcGIS for Server
then follow this blog post (even know it says printing popups):
Printing Popups from Web Application | ArcGIS Blog
I personally have made changes to the Print Widgets Print.js to look for a specific layer in the map and if that layer is present then add certain attributes to the layouts customTextElements.
So in the Print.js print function:
print<SPAN class="punctuation token">:</SPAN> <SPAN class="keyword token">function</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN> <SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>printSettingsFormDijit<SPAN class="punctuation token">.</SPAN><SPAN class="token function">isValid</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN> <SPAN class="keyword token">var</SPAN> form <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>printSettingsFormDijit<SPAN class="punctuation token">.</SPAN><SPAN class="keyword token">get</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">'value'</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> lang<SPAN class="punctuation token">.</SPAN><SPAN class="token function">mixin</SPAN><SPAN class="punctuation token">(</SPAN>form<SPAN class="punctuation token">,</SPAN> <SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>layoutMetadataDijit<SPAN class="punctuation token">.</SPAN><SPAN class="keyword token">get</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">'value'</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>preserve <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>preserveFormDijit<SPAN class="punctuation token">.</SPAN><SPAN class="keyword token">get</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">'value'</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> lang<SPAN class="punctuation token">.</SPAN><SPAN class="token function">mixin</SPAN><SPAN class="punctuation token">(</SPAN>form<SPAN class="punctuation token">,</SPAN> <SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>preserve<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>layoutForm <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>layoutFormDijit<SPAN class="punctuation token">.</SPAN><SPAN class="keyword token">get</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">'value'</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">var</SPAN> mapQualityForm <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>mapQualityFormDijit<SPAN class="punctuation token">.</SPAN><SPAN class="keyword token">get</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">'value'</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">var</SPAN> mapOnlyForm <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>mapOnlyFormDijit<SPAN class="punctuation token">.</SPAN><SPAN class="keyword token">get</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">'value'</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> lang<SPAN class="punctuation token">.</SPAN><SPAN class="token function">mixin</SPAN><SPAN class="punctuation token">(</SPAN>mapOnlyForm<SPAN class="punctuation token">,</SPAN> mapQualityForm<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">var</SPAN> elementsObj <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>customTextElementsDijit<SPAN class="punctuation token">.</SPAN><SPAN class="keyword token">get</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">'value'</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">var</SPAN> cteArray <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">[</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">for</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">var</SPAN> p <SPAN class="keyword token">in</SPAN> elementsObj<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN> <SPAN class="keyword token">var</SPAN> cte <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">{</SPAN><SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">;</SPAN> cte<SPAN class="punctuation token">[</SPAN>p<SPAN class="punctuation token">]</SPAN> <SPAN class="operator token">=</SPAN> elementsObj<SPAN class="punctuation token">[</SPAN>p<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">;</SPAN> cteArray<SPAN class="punctuation token">.</SPAN><SPAN class="token function">push</SPAN><SPAN class="punctuation token">(</SPAN>cte<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="keyword token">var</SPAN> template <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">PrintTemplate</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> template<SPAN class="punctuation token">.</SPAN>format <SPAN class="operator token">=</SPAN> form<SPAN class="punctuation token">.</SPAN>format<SPAN class="punctuation token">;</SPAN> template<SPAN class="punctuation token">.</SPAN>layout <SPAN class="operator token">=</SPAN> form<SPAN class="punctuation token">.</SPAN>layout<SPAN class="punctuation token">;</SPAN> template<SPAN class="punctuation token">.</SPAN>preserveScale <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">(</SPAN>form<SPAN class="punctuation token">.</SPAN>preserveScale <SPAN class="operator token">===</SPAN> <SPAN class="string token">'true'</SPAN> <SPAN class="operator token">||</SPAN> form<SPAN class="punctuation token">.</SPAN>preserveScale <SPAN class="operator token">===</SPAN> <SPAN class="string token">'force'</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> template<SPAN class="punctuation token">.</SPAN>label <SPAN class="operator token">=</SPAN> form<SPAN class="punctuation token">.</SPAN>title<SPAN class="punctuation token">;</SPAN> template<SPAN class="punctuation token">.</SPAN>exportOptions <SPAN class="operator token">=</SPAN> mapOnlyForm<SPAN class="punctuation token">;</SPAN> <SPAN class="comment token">//Hide map attribution</SPAN> template<SPAN class="punctuation token">.</SPAN>showAttribution <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">false</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="comment token">//end my change</SPAN> template<SPAN class="punctuation token">.</SPAN>layoutOptions <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">{</SPAN> authorText<SPAN class="punctuation token">:</SPAN> form<SPAN class="punctuation token">.</SPAN>author<SPAN class="punctuation token">,</SPAN> copyrightText<SPAN class="punctuation token">:</SPAN> form<SPAN class="punctuation token">.</SPAN>copyright<SPAN class="punctuation token">,</SPAN> legendLayers<SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>layoutForm<SPAN class="punctuation token">.</SPAN>legend<SPAN class="punctuation token">.</SPAN>length <SPAN class="operator token">></SPAN> <SPAN class="number token">0</SPAN> <SPAN class="operator token">&&</SPAN> <SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>layoutForm<SPAN class="punctuation token">.</SPAN>legend<SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">?</SPAN> <SPAN class="keyword token">null</SPAN> <SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">[</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN> titleText<SPAN class="punctuation token">:</SPAN> form<SPAN class="punctuation token">.</SPAN>title<SPAN class="punctuation token">,</SPAN> customTextElements<SPAN class="punctuation token">:</SPAN> cteArray <SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="comment token">//See if there is a parcel search layer added to the map</SPAN> <SPAN class="keyword token">var</SPAN> plyr<SPAN class="punctuation token">;</SPAN> array<SPAN class="punctuation token">.</SPAN><SPAN class="token function">some</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>map<SPAN class="punctuation token">.</SPAN>graphicsLayerIds<SPAN class="punctuation token">,</SPAN> lang<SPAN class="punctuation token">.</SPAN><SPAN class="token function">hitch</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="keyword token">function</SPAN> <SPAN class="punctuation token">(</SPAN>layerId<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN> <SPAN class="keyword token">var</SPAN> lyr <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>map<SPAN class="punctuation token">.</SPAN><SPAN class="token function">getLayer</SPAN><SPAN class="punctuation token">(</SPAN>layerId<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">if</SPAN><SPAN class="punctuation token">(</SPAN>lyr<SPAN class="punctuation token">.</SPAN>name <SPAN class="operator token">===</SPAN> <SPAN class="string token">"Search Results: Parcels"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">{</SPAN> plyr <SPAN class="operator token">=</SPAN> lyr<SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">return</SPAN> <SPAN class="keyword token">true</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">if</SPAN><SPAN class="punctuation token">(</SPAN>plyr<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">{</SPAN> <SPAN class="keyword token">var</SPAN> xppins <SPAN class="operator token">=</SPAN> <SPAN class="string token">""</SPAN><SPAN class="punctuation token">,</SPAN> obj<SPAN class="punctuation token">,</SPAN> cTextElements <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">[</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">;</SPAN> array<SPAN class="punctuation token">.</SPAN><SPAN class="token function">map</SPAN><SPAN class="punctuation token">(</SPAN>plyr<SPAN class="punctuation token">.</SPAN>graphics<SPAN class="punctuation token">,</SPAN> lang<SPAN class="punctuation token">.</SPAN><SPAN class="token function">hitch</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="keyword token">function</SPAN><SPAN class="punctuation token">(</SPAN>gra<SPAN class="punctuation token">,</SPAN> index<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">{</SPAN> <SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>plyr<SPAN class="punctuation token">.</SPAN>graphics<SPAN class="punctuation token">.</SPAN>length <SPAN class="operator token">===</SPAN> <SPAN class="number token">1</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">{</SPAN> obj <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">{</SPAN>OwnerName<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"Owner Name: "</SPAN> <SPAN class="operator token">+</SPAN> gra<SPAN class="punctuation token">.</SPAN>attributes<SPAN class="punctuation token">.</SPAN>NAME<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">;</SPAN> cTextElements<SPAN class="punctuation token">.</SPAN><SPAN class="token function">push</SPAN><SPAN class="punctuation token">(</SPAN>obj<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> obj <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">{</SPAN>PPIN<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"PPIN: "</SPAN> <SPAN class="operator token">+</SPAN> gra<SPAN class="punctuation token">.</SPAN>attributes<SPAN class="punctuation token">.</SPAN>PPIN<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">;</SPAN> cTextElements<SPAN class="punctuation token">.</SPAN><SPAN class="token function">push</SPAN><SPAN class="punctuation token">(</SPAN>obj<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> obj <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">{</SPAN>ParcelNum<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"Parcel Number: "</SPAN> <SPAN class="operator token">+</SPAN> gra<SPAN class="punctuation token">.</SPAN>attributes<SPAN class="punctuation token">.</SPAN>PARCEL_NUMBER<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">;</SPAN> cTextElements<SPAN class="punctuation token">.</SPAN><SPAN class="token function">push</SPAN><SPAN class="punctuation token">(</SPAN>obj<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> obj <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">{</SPAN>StreetAdd<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"Street Address: "</SPAN> <SPAN class="operator token">+</SPAN> gra<SPAN class="punctuation token">.</SPAN>attributes<SPAN class="punctuation token">.</SPAN>STREET_ADDRESS<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">;</SPAN> cTextElements<SPAN class="punctuation token">.</SPAN><SPAN class="token function">push</SPAN><SPAN class="punctuation token">(</SPAN>obj<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="punctuation token">}</SPAN><SPAN class="keyword token">else</SPAN> <SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>plyr<SPAN class="punctuation token">.</SPAN>graphics<SPAN class="punctuation token">.</SPAN>length <SPAN class="operator token">></SPAN> <SPAN class="number token">1</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">{</SPAN> <SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>xppins <SPAN class="operator token">===</SPAN> <SPAN class="string token">""</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">{</SPAN> xppins <SPAN class="operator token">=</SPAN> gra<SPAN class="punctuation token">.</SPAN>attributes<SPAN class="punctuation token">.</SPAN>PPIN<SPAN class="punctuation token">;</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="keyword token">else</SPAN> <SPAN class="punctuation token">{</SPAN> <SPAN class="keyword token">if</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">7</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="number token">16</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="number token">25</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="number token">34</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="number token">43</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="number token">52</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="number token">61</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="number token">70</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="number token">79</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="number token">88</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="number token">97</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="token function">indexOf</SPAN><SPAN class="punctuation token">(</SPAN>index<SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">></SPAN> <SPAN class="operator token">-</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">{</SPAN> xppins <SPAN class="operator token">=</SPAN> xppins <SPAN class="operator token">+</SPAN> <SPAN class="string token">",\r\n"</SPAN> <SPAN class="operator token">+</SPAN> gra<SPAN class="punctuation token">.</SPAN>attributes<SPAN class="punctuation token">.</SPAN>PPIN<SPAN class="punctuation token">;</SPAN> <SPAN class="punctuation token">}</SPAN><SPAN class="keyword token">else</SPAN><SPAN class="punctuation token">{</SPAN> xppins <SPAN class="operator token">=</SPAN> xppins <SPAN class="operator token">+</SPAN> <SPAN class="string token">", "</SPAN> <SPAN class="operator token">+</SPAN> gra<SPAN class="punctuation token">.</SPAN>attributes<SPAN class="punctuation token">.</SPAN>PPIN<SPAN class="punctuation token">;</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="punctuation token">}</SPAN> obj <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">{</SPAN>OwnerName<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"Selected PPINs: "</SPAN> <SPAN class="operator token">+</SPAN> xppins<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">;</SPAN> cTextElements<SPAN class="punctuation token">.</SPAN><SPAN class="token function">push</SPAN><SPAN class="punctuation token">(</SPAN>obj<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="punctuation token">}</SPAN> template<SPAN class="punctuation token">.</SPAN>layoutOptions<SPAN class="punctuation token">.</SPAN>customTextElements <SPAN class="operator token">=</SPAN> cTextElements<SPAN class="punctuation token">;</SPAN> <SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="comment token">//end my change</SPAN> <SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>printparams<SPAN class="punctuation token">.</SPAN>template <SPAN class="operator token">=</SPAN> template<SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>printparams<SPAN class="punctuation token">.</SPAN>extraParameters <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">{</SPAN> <SPAN class="comment token">// come from source code of jsapi</SPAN> printFlag<SPAN class="punctuation token">:</SPAN> <SPAN class="keyword token">true</SPAN> <SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">var</SPAN> fileHandel <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>printTask<SPAN class="punctuation token">.</SPAN><SPAN class="token function">execute</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>printparams<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">var</SPAN> result <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">printResultDijit</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">{</SPAN> count<SPAN class="punctuation token">:</SPAN> <SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>count<SPAN class="punctuation token">.</SPAN><SPAN class="token function">toString</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN> icon<SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">(</SPAN>form<SPAN class="punctuation token">.</SPAN>format <SPAN class="operator token">===</SPAN> <SPAN class="string token">"PDF"</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">?</SPAN> <SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>pdfIcon <SPAN class="punctuation token">:</SPAN> <SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>imageIcon<SPAN class="punctuation token">,</SPAN> docName<SPAN class="punctuation token">:</SPAN> form<SPAN class="punctuation token">.</SPAN>title<SPAN class="punctuation token">,</SPAN> title<SPAN class="punctuation token">:</SPAN> form<SPAN class="punctuation token">.</SPAN>format <SPAN class="operator token">+</SPAN> <SPAN class="string token">', '</SPAN> <SPAN class="operator token">+</SPAN> form<SPAN class="punctuation token">.</SPAN>layout<SPAN class="punctuation token">,</SPAN> fileHandle<SPAN class="punctuation token">:</SPAN> fileHandel<SPAN class="punctuation token">,</SPAN> nls<SPAN class="punctuation token">:</SPAN> <SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>nls <SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="token function">placeAt</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>printResultsNode<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'last'</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> result<SPAN class="punctuation token">.</SPAN><SPAN class="token function">startup</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> domStyle<SPAN class="punctuation token">.</SPAN><SPAN class="keyword token">set</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>clearActionBarNode<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'display'</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'block'</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>count<SPAN class="operator token">++</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="keyword token">else</SPAN> <SPAN class="punctuation token">{</SPAN> <SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>printSettingsFormDijit<SPAN class="punctuation token">.</SPAN><SPAN class="token function">validate</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
I've tried to use that Blog about 40 times now, but I don't seem to understand the link between the customtextelements and parcel layer information and getting them into the map document, all I get is errors, or blank pages.
Not sure if I can explain it any better then the blog post. Once you have your custom text element added to your custom layout for your custom print service, then the print service will just add any text provided in the customTextElements array object that it can find a matching element name for in the print template. So as you can see in my code provided previously "OwnerName" is a custom text element in my print layout and the code:
obj <SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.498039); border: 0px; font-weight: inherit; font-size: 14px;">=</SPAN> <SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;">{</SPAN>OwnerName<SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;">:</SPAN> <SPAN class="" style="color: #669900; border: 0px; font-weight: inherit; font-size: 14px;">"Owner Name: "</SPAN> <SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.498039); border: 0px; font-weight: inherit; font-size: 14px;">+</SPAN> gra<SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;">.</SPAN>attributes<SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;">.</SPAN>NAME<SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;">}</SPAN><SPAN class="" style="color: #999999; border: 0px; font-weight: inherit; font-size: 14px;">;</SPAN>
Adds the custom text element object to the layoutTemplates customTextElements array.
Can you share the full Print.js your using.
Robert this would be a really cool feature to your Enhanced Search Widget.
Hi Robert,
So, I have followed the tutorial Tanu Posted for printing the popups(Printing Popups from Web Application, #2).
The print service works- map is printed, feature is selected.. but no attributes on the second page.
It appears the problem is seemingly very simple...
The attributes of the popups I want to print are from a rest service layer, which is within the map of the app.
The attributes of the popup only come from one layer.
The attributes have names and aliases, and are named differently in the popups as well.
What name do I put in the "Element Name" text box in the properties box in arcmap when setting up my layout mxd?
The field names listed in the rest service? (PARCELID) The alias names?(Parcel Ident...)
or the names listed in the popup configuration? (i.e. Owner, Sale Price...)
Or something completely different? (like FIELDS)
Then, how should the syntax be changed in the script?
Thank you so much for your help!
Lauren,
In that custom python script you are referencing each of the selected features attributes should be printed.
It would look like this:
Layer Name
Field name Field value
..... ................
If you are not getting this then you have made a mistake or missed a step.
The Discussion James an I are having in this thread does not use that custom python script print service. I make edits to the Print widget in WAB Dev Edition to check for a specific graphics layer in the app and take that GLs specific attributes and add them to the print widgets cTextElements (custom text elements object). The names of those custom text elements match the names of the elements in my custom print layout template.
I recently upgraded to Developer 2.4 and ESearch 2.4 and this no longer seems to work, the operational layer doesn't supply the Print widget the parcel details anymore. Any ideas to why?
I made the changes to the Print.js in a new 2.4 app and made sure that the eSearch widgets result were added as an operational layer and the print widget was using my print service that had the custom print template and I had no issue at all.
Well I made it work again by downgrading the Print and Esearch Widgets back to 2.1.2, I couldn't get them to work in the new 2.4, I guess I'll have to try remaking everything from the start.
Strange, Like I said I used 2.4 WAB and 2.4 versions of the widgets without issue.
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.