I am having a problem displaying a large Legend (with more than 60 items) on the print task, it appears that the legend doesn't appear at all at the printed template.

It does print fine if there are few results (I tested a legend with less than 25 items and it works fine).

I am using the default Print widget of the webappbuilder tool with a little customization.

I am using ArcGIS JavaScript v3.18 and WebAppBuilder

Is there any solution to this ?

Here is a code sample of the point where the webappbuilder execute a print request.

 var template = new PrintTemplate();
 template.format = form.format;
 template.layout = form.layout;
 template.preserveScale = (form.preserveScale === 'true' || form.preserveScale === 'force');
 template.label = form.title;
 template.exportOptions = mapOnlyForm;
 template.layoutOptions = {
 authorText: hasAuthorText ? form.author : "",
 copyrightText: hasCopyrightText ? (form.copyright || this._getMapAttribution()) : "",
 legendLayers: legendLayers,//contains LegendLayer array that contains ids of the operational layer added to map.
 titleText: hasTitleText ? form.title : "",
                customTextElements: cteArray
 this.printparams.template = template;
 this.printparams.extraParameters = { // come from source code of jsapi
                printFlag: true
 var fileHandel = this.printTask.execute(this.printparams, function (res) {
          //res contains a link to the new printed template.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.