<?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 .NET Graphics Layer Legend Problem with Print Service in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/net-graphics-layer-legend-problem-with-print/m-p/286287#M3382</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;We have custom print/export map services that uses custom MXD print templates. The templates have the standard "Legend" component (ArcMap -&amp;gt; Insert -&amp;gt; Legend). We have a .NET SDK that have multiple graphics layers. When I print/export with the map services, the Legend area shows some random ID/GUID each time for the graphics layers everytime I print. How can I remove these random long IDs, and show the proper graphics layer display name / ID instead?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried to set the graphic layers' IDs and DisplayName properties but this did not work (in fact, I get different IDs each time I print with the same graphics layers, so problem isn't with the graphic layers' IDs or DisplayName properties).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is code snippet for creating graphics layers:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;private void AddDefaultGraphicsLayer(String ID)&lt;BR /&gt; {&lt;BR /&gt;&amp;nbsp; var graphicsLayer = new GraphicsLayer();&lt;BR /&gt;&amp;nbsp; graphicsLayer.ID = ID;&lt;BR /&gt;&amp;nbsp; graphicsLayer.DisplayName = ID;&lt;BR /&gt;&amp;nbsp; //graphicsLayer.ShowLegend = false;&lt;BR /&gt;&amp;nbsp; MyMap.Layers.Add(graphicsLayer);&lt;BR /&gt; }&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think it is something to do with legend (because if I set ShowLegend to true, the random ID shows; if I set it false, random ID disppears).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using ArcGIS .NET SDK 10.2.7 with ArcGIS for Desktop (to create print templates) and Server (print services) with version 10.5.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Nov 2017 21:30:36 GMT</pubDate>
    <dc:creator>HenryAtWork</dc:creator>
    <dc:date>2017-11-28T21:30:36Z</dc:date>
    <item>
      <title>.NET Graphics Layer Legend Problem with Print Service</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/net-graphics-layer-legend-problem-with-print/m-p/286287#M3382</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;We have custom print/export map services that uses custom MXD print templates. The templates have the standard "Legend" component (ArcMap -&amp;gt; Insert -&amp;gt; Legend). We have a .NET SDK that have multiple graphics layers. When I print/export with the map services, the Legend area shows some random ID/GUID each time for the graphics layers everytime I print. How can I remove these random long IDs, and show the proper graphics layer display name / ID instead?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried to set the graphic layers' IDs and DisplayName properties but this did not work (in fact, I get different IDs each time I print with the same graphics layers, so problem isn't with the graphic layers' IDs or DisplayName properties).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is code snippet for creating graphics layers:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;private void AddDefaultGraphicsLayer(String ID)&lt;BR /&gt; {&lt;BR /&gt;&amp;nbsp; var graphicsLayer = new GraphicsLayer();&lt;BR /&gt;&amp;nbsp; graphicsLayer.ID = ID;&lt;BR /&gt;&amp;nbsp; graphicsLayer.DisplayName = ID;&lt;BR /&gt;&amp;nbsp; //graphicsLayer.ShowLegend = false;&lt;BR /&gt;&amp;nbsp; MyMap.Layers.Add(graphicsLayer);&lt;BR /&gt; }&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think it is something to do with legend (because if I set ShowLegend to true, the random ID shows; if I set it false, random ID disppears).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using ArcGIS .NET SDK 10.2.7 with ArcGIS for Desktop (to create print templates) and Server (print services) with version 10.5.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Nov 2017 21:30:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/net-graphics-layer-legend-problem-with-print/m-p/286287#M3382</guid>
      <dc:creator>HenryAtWork</dc:creator>
      <dc:date>2017-11-28T21:30:36Z</dc:date>
    </item>
  </channel>
</rss>

