Print task not showing layer generated with dynamic renderer from a Feature layer using join with a relational table

Discussion created by Athanasis77 on Apr 19, 2018

Dear all,


I'm having a major problem to execute the print task in my application. My map contains a feature layer where the features are previously joined with a relational (i.e. postgresql) table. I use the GenerateRendererTask to generate a Natural Breaks renderer with some classes, as described here in the API samples.

The layer is shown fine in the map and when I fire the Print button the print task is executed without any error / warning in the code. However the exported map contains only the basemap layer and the graphics from the feature service are ignored. See Fig 1 and Fig 2 attached. When I use the Print task with the same feature layer but with no use of the GenerateRendererTask, the map is printed correctly.  Furthermore, when I substitute the feature layer with another feature layer  not joined with a relational table the print task is also executed as expected. See Figs. 3 and 4 attached.  Thus, the problem – as far as I can assume- is when I want to use the Print task with the GenerateRendererTask in a feature layer where the features are previously joined with a relational (i.e. postgresql) table. The only necessary modifications I have done between the first  case (i.e unsuccessfull printing with renederer from feature layer joined with relational table) and the second case ((i.e successfull printing with renederer from feature layer without any join with relational table) are:

  1. The app.countiesUrl value. In the first page the value is:

<local ip>/gis/rest/services/printtestjoin/MapServer/0" while in the second page:

<local ip>/gis/rest/services/printtestmerge/MapServer/0

  1. The app.outFields and the app.currentAttribute variables. In the first page their values are:

app.outFields = ["<postgresDB>.<schema>.<table>.<field> "];

app.currentAttribute = "<postgresDB>.<schema>.<table>.<field>";

while in the second page their values are:

app.outFields = ["<field>"];

app.currentAttribute = "<field>";



 Can you please give me any idea about this issue? Below you can find the code for the first page that leads to the unsuccessfull printing.

Unfortunately links to real the pages cannot be provided because the whole application runs under a local intranet.


Thank you in advance.




         app.printUrl = "https://<local_ip>/gis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task";

  = "/proxy/"; = new Map("map", {

         center: [24, 39],

          basemap: "osm",

          zoom: 7,

          slider: false




        app.printer = new Print({


          url: "https://<local_ip>/gis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task"

        }, dom.byId("printButton"));



        app.countiesUrl = "http://<local_ip>/gis/rest/services/printtestjoin/MapServer/0";

        app.layerDef =  layerdef_string;

        app.outFields = ["<postgresDB>.<schema>.<table>.<field>"];

        app.currentAttribute = "<postgresDB>.<schema>.<table>.<field>";



      "load", function() {

          app.wash = new FeatureLayer(app.countiesUrl, {

            "id": "layerid",


            "maxAllowableOffset": maxOffset(),

            "mode": FeatureLayer.MODE_SNAPSHOT







          // colors for the renderer

          app.defaultFrom = Color.fromHex("#FEEECC");

          app.defaultTo = Color.fromHex("#F57917");





        });      "zoom-end", updateMaxOffset);


        var fieldNames, fieldStore, fieldSelect;


        function createRenderer(field) {

          app.sfs = new SimpleFillSymbol(


            new SimpleLineSymbol(


              new Color([0, 0, 0]),





          var classDef = new ClassBreaksDefinition();

          classDef.classificationField = app.currentAttribute;

          classDef.classificationMethod = "natural-breaks";

          classDef.breakCount = 5;

          classDef.baseSymbol = app.sfs;


          var colorRamp = new AlgorithmicColorRamp();

          colorRamp.fromColor = app.defaultFrom;

          colorRamp.toColor = app.defaultTo;

          colorRamp.algorithm = "hsv";

          classDef.colorRamp = colorRamp;


          var params = new GenerateRendererParameters();

          params.classificationDefinition = classDef;

           params.where = app.layerDef;

          var generateRenderer = new GenerateRendererTask(app.countiesUrl);

          generateRenderer.execute(params, applyRenderer, errorHandler);



        function applyRenderer(renderer) {




        function updateAttribute(ch) {         

          app.currentAttribute = ch;




        function updateMaxOffset() {

          var offset = maxOffset();




        function maxOffset() {

          return ( /;



        function errorHandler(err) {

          console.log('Oops, error: ', err);






  <body class="tundra">

    <div data-dojo-type="dijit.layout.BorderContainer"


         style="width: 100%; height: 100%; margin: 0;">

      <div id="map"



<div id="printButton"></div>