Layer Legend shows in Legend widget, but did not show in print.

338
7
08-17-2018 08:51 AM
Ran_Deng
New Contributor

Hi,

has anyone encountered issue with the Print widget where the layer legend shows in the legend widget, but it did not show when using print widget to print. 

I'm having issue with the print widget, where it prints all the legends that shows in the legend widget except for one layer. what would be the potential cause for this? Thanks!!

Thanks,

Ryan

0 Kudos
7 Replies
JohnLucotch2
New Contributor III

What kind of layer is it?  

0 Kudos
MichaelVolz
Esteemed Contributor

Can you provide screenshots of the legend widget as well as how it looks through the print widget?

0 Kudos
Ran_Deng
New Contributor

Hi Michael, 

left is from legend widget and right is from the pdf, and the data show up in the map without any issue and no error returned when retrieving the layer. 

Thanks,

Ryan

0 Kudos
Ran_Deng
New Contributor

Hi John, 

it's dynamic layer. "ArcGISDynamicMapServiceLayer". but somehow only this layer is behaving this way, I republished it few times but still doing the same thing. 

Thanks,

Ryan 

0 Kudos
MichaelVolz
Esteemed Contributor

Is this your own org's custom print service?

Are all the services from your org or do you bring in external services?

0 Kudos
Ran_Deng
New Contributor

All the services are from within my org, no external services. The print service is the out-of-the-box one that comes with the server and portal, should be the default setting.  

0 Kudos
Ran_Deng
New Contributor

Somehow it works when I use on load to addLayer, instead of addLayer directly. No idea why do I need to do that. 

var randomStuffDynamicTemplate = {};
      randomStuffDynamicTemplate[0] = { infoTemplate: randomStuffTemplate };
var randomStuffDynamicLayer = new ArcGISDynamicMapServiceLayer(randomStuffDynUrl,
      {id: "randomStuffDynamicLayer", name: "randomStuff Location", outFields: ["*"] , minScale: randomStuffLocMinVal, imageformat: "png32"});


      randomStuffDynamicLayer.setVisibleLayers([0]);
      randomStuffDynamicLayer.setInfoTemplates(randomStuffDynamicTemplate);


var randomStuffLayerDefinitions = [];
      randomStuffLayerDefinitions[0] = randomStuff_ID;

var randomStuffLayerDrawingOptions= [];
var randomStuffLayerDrawingOption = new LayerDrawingOptions();
      randomStuffLayerDrawingOption.renderer=randomStuffRenderer;
      randomStuffLayerDrawingOptions[0] = randomStuffLayerDrawingOption;

      randomStuffDynamicLayer.setLayerDrawingOptions(randomStuffLayerDrawingOptions);
      randomStuffDynamicLayer.setLayerDefinitions(randomStuffLayerDefinitions);


      randomStuffDynamicLayer.on("load", lang.hitch(this,addMapThatLayer));
      function addMapThatLayer(){
         this.map.addLayer(randomStuffDynamicLayer);
         };

0 Kudos