Harshal
the reason you are not seeing anything on the legend is because the sublayer id you specified inside 'legendOptions.opertaionalLayers.sublayerIds' has scale-visibility range set. the scale you are requesting the output is beyond that scale range, as result the layer does not draw, therefore nothing shows up in the legend.
here is the modified version (scale is set to 1:50,000) of your json that I tried and got the legends shown up in the output:
{"mapOptions":{"showAttribution":true,"extent":{"xmin":-8851509.581441754,"ymin":4234412.018976383,"xmax":-8642683.620166572,"ymax":4296784.63405711,"spatialReference":{"wkid":102100,"latestWkid":3857}},"spatialReference":{"wkid":102100,"latestWkid":3857},"scale":50000},"operationalLayers":[{"id":"layerActiveMonumentsLayer","title":"layerActiveMonumentsLayer","opacity":1,"url":"http://servicesbeta2.esri.com/arcgis/rest/services/Census/MapServer","layers":[]}],"exportOptions":{"outputSize":[800,1100],"dpi":96},"layoutOptions":{"customTextElements":[{"titleText":"title"},{"projectName":"NC Geodetic Database"}],"scaleBarOptions":{},"legendOptions":{"operationalLayers":[{"id":"layerActiveMonumentsLayer","subLayerIds":[0]}]}}}
here is the entire request to the printing service.
http://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/....
you can also try by removing the subLayerIds to have legends from all layers shown.
http://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools...
Thanks.
Tanu
Harshal,
if you service is shared publicly, I'd appreciate if could share the new json (with url pointing to your service) with me and I will be more than happy to take a look.
thanks.
Tanu
Thanks for replying Tanu! I would not be able to share the url however I can share the screen if you wish through skype if it is alrite with you.. My skype id is 'harshal_82' and msn is 'harshal2009@live.com.
Thanks,
Harshal
Harshal,
Unfortunately I can't do the skype thing.
I'd really appreciate if you could contact Esri Tech Support and have them look into the problem remotely.
Thanks a lot.
Tanu
I'm not sure why/how the email on this thread showed up in my inbox today.
Anyways, I think it is a good thing that happened I probably understand what you mean this time around. You meant the 'layer names' are not showing up in the legend element for "class breaks" and "unique value" renderers, no job failure or error right? and because of that you'd not know which layer a legend patch belongs too.
If i understood the issue correctly, then there is a good news that the bug got fixed in 10.3.
Hi Tanu
You can test if the issue is resolved with Esri's 10.3 version of the print service at http://utility.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%2...