Removing the calculation of area/length in the Screening Widget report?

1401
4
Jump to solution
01-31-2019 04:55 PM
MartinOwens1
Occasional Contributor II

I'm curious if anyone knows how I might be able to remove the calculation in the report for certain layers. I've been able to identilfy them by the feature layer ID and simply hide the calculation in the info report summary "widget panel" but can't seem to figure out how to remove it from the printed report.

If possible I would like to remove the entire column for the calculated area for certain layers. 

Any help would be great.

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Martin,

   Well that took some digging... You will need to edit the widget.js _getProcessedPrintData:

Line 255 - 257 are the original but if this is one of those layer you need to hide the area for then replace with lines 258 - 259.  Also line 89 has to be remove for your specific layer as well. I did not write any evaluation code for you this is just showing what needs to change to remove the area column from the report.

    /**
     * This function is used to get the data needed for printing the report
     * @memberOf Screening/Widget
     */
    _getProcessedPrintData: function () {

      var dataForReport, areaOfInterestText, areaOfInterestValue, aoiTextTemplate,
        aoiText, printMap, id, unableToAnalyzeText, showUnableToAnalyzeText,
        summaryTableMeasurement;

      dataForReport = [];
      areaOfInterestText = this.nls.reportsTab.aoiInformationTitle;

      if (!domClass.contains(this.aoiFeetUnitAreaContainer, "esriCTHidden")) {
        areaOfInterestValue = this.aoiFeetUnitAreaContainer.innerHTML;
      } else if (!domClass.contains(this.aoiMilesUnitAreaContainer, "esriCTHidden")) {
        areaOfInterestValue = this.aoiMilesUnitAreaContainer.innerHTML;
      } else if (!domClass.contains(this.aoiMetersUnitAreaContainer, "esriCTHidden")) {
        areaOfInterestValue = this.aoiMetersUnitAreaContainer.innerHTML;
      } else if (!domClass.contains(this.aoiKilometersUnitAreaContainer, "esriCTHidden")) {
        areaOfInterestValue = this.aoiKilometersUnitAreaContainer.innerHTML;
      } else if (!domClass.contains(this.aoiHectaresUnitAreaContainer, "esriCTHidden")) {
        areaOfInterestValue = this.aoiHectaresUnitAreaContainer.innerHTML;
      }

      // Add AOI text on top of the report
      if (this.reportDijit.Date) {
        aoiTextTemplate =
          "<div class='esrCTAOIInfoDiv'>" +
          // Title
          "<div class='esriAOITitle'>" +
          "<input class='esriCTAOITitleInput' type='text' value='" + areaOfInterestText + "'>" +
          "</div>" +
          // Area
          "<div class='esriCTAOIArea'>" +
          "<input class='esriCTAOIInputArea' type='text' value='" + areaOfInterestValue + "'>" +
          "</div>" +
          // Date
          "<div class='esriCTPrintLocaleDateDiv'>" +
          "<input type='text' class='esriCTLocaleDateInputTitle' value='" +
          this._getDate() + "'>" +
          "</div>" +
          "</div>";
      } else {
        aoiTextTemplate =
          "<div class='esrCTAOIInfoDiv'>" +
          // Title
          "<div class='esriAOITitle'>" +
          "<input class='esriCTAOITitleInput' type='text' value='" + areaOfInterestText + "'>" +
          "</div>" +
          // Area
          "<div class='esriCTAOIArea'>" +
          "<input class='esriCTAOIInputArea' type='text' value='" + areaOfInterestValue + "'>" +
          "</div>" +
          "</div>";
      }

      aoiText = {
        title: "",
        type: "html",
        data: aoiTextTemplate
      };
      dataForReport.push(aoiText);

      //add Map at the top in the report
      printMap = {
        addPageBreak: true,
        type: "map",
        map: this.map,
        printTemplate: this._getPrintTemplate()
      };
      dataForReport.push(printMap);
      dataForReport.push({
        "type": "note",
        "addPageBreak": false
      });

      //Impact summary table
      var impactSummaryTable = {
        title: this.nls.reportsTab.summaryReportTitle,
        addPageBreak: false,
        type: "table",
        data: {
          "showRowIndex": false,
          "maxNoOfCols": 4,
          "rows": [],
          "cols": [this.nls.common.name,
          this._getAggregatedColTitle("esriGeometryPoint"),
          //this._getAggregatedColTitle("esriGeometryPolygon"),
          this._getAggregatedColTitle("esriGeometryPolyline")
          ]
        }
      };

      for (id in this._printData) {
        var data, reportTable, matchedIndex, temp, aggregatedObj, aggregatedId, impactArray,
          impactSummaryAggregatedValue, selectedUnitValue;
        data = this._printData[id].info;
        impactArray = [];
        // no results found
        if (data.rows && data.rows.length > 0) {
          // fields off
          // configure check && layer invisible
          if (data.cols && data.cols.length > 0) {
            impactArray = [data.title];
            matchedIndex = [];
            aggregatedObj = {};
            for (var i = 0; i < data.rows.length; i++) {
              //if current index is not found in matched index then search array of that index
              if (matchedIndex.indexOf(i) < 0) {
                temp = this._getArrayIndex(data.rows, data.rows[i]);
                aggregatedObj[i] = temp;
                matchedIndex = matchedIndex.concat(temp);
              }
              //if all index are matched break loop
              if (matchedIndex.length === data.rows.length) {
                break;
              }
            }
            var aggregatedData = {
              "showRowIndex": true,
              "rows": [],
              "cols": lang.clone(data.cols)
            };
            //based on selected unit add col
            aggregatedData.cols.push(this._getAggregatedColTitle(this._printData[id].geometryType));

            for (aggregatedId in aggregatedObj) {
              var newRowInaggregatedData = lang.clone(data.rows[parseInt(aggregatedId, 10)]);
              selectedUnitValue = this.analysisUnitSelect.get('value');

              switch (selectedUnitValue) {
                case "Feet":
                  newRowInaggregatedData.push(
                    this.getSum(this._printData[id].feetUnitInfo,
                      aggregatedObj[parseInt(aggregatedId, 10)]));
                  break;
                case "Miles":
                  newRowInaggregatedData.push(
                    this.getSum(this._printData[id].milesUnitInfo,
                      aggregatedObj[parseInt(aggregatedId, 10)]));
                  break;
                case "Meters":
                  newRowInaggregatedData.push(
                    this.getSum(this._printData[id].metersUnitInfo,
                      aggregatedObj[parseInt(aggregatedId, 10)]));
                  break;
                case "Kilometers":
                  newRowInaggregatedData.push(
                    this.getSum(this._printData[id].kilometersUnitInfo,
                      aggregatedObj[parseInt(aggregatedId, 10)]));
                  break;
                case "Hectares":
                  newRowInaggregatedData.push(
                    this.getSum(this._printData[id].hectaresUnitInfo,
                      aggregatedObj[parseInt(aggregatedId, 10)]));
                  break;
              }
              aggregatedData.rows.push(newRowInaggregatedData);
            }

            if (aggregatedData.rows && aggregatedData.rows.length > 0) {
              /*sort data in descending order so that rows for which measurement are not to be shown
              will be shifted to bottom*/
              aggregatedData.rows = aggregatedData.rows.sort(this._sortFeatureArray);
              //if last col in row have value 0 show N/A
              aggregatedData.rows = array.map(aggregatedData.rows,
                lang.hitch(this, this._setNotApplicableRows));

              aggregatedData = this._addCommaToAreaAndLengthColumn(aggregatedData, this._printData[id].geometryType);

              reportTable = {
                title: data.title,
                addPageBreak: false,
                type: "table",
                data: aggregatedData
              };
              dataForReport.push(reportTable);

              switch (selectedUnitValue) {
                case "Feet":
                  if (this._printData[id].geometryType !== "esriGeometryPoint") {
                    impactSummaryAggregatedValue =
                      dojoNumber.format(this.getSum(this._printData[id].feetUnitInfo), {
                        places: 2
                      });
                  } else {
                    impactSummaryAggregatedValue =
                      dojoNumber.format(this.getSum(this._printData[id].feetUnitInfo));
                  }
                  break;
                case "Miles":
                  if (this._printData[id].geometryType !== "esriGeometryPoint") {
                    impactSummaryAggregatedValue =
                      dojoNumber.format(this.getSum(this._printData[id].milesUnitInfo), {
                        places: 2
                      });
                  } else {
                    impactSummaryAggregatedValue =
                      dojoNumber.format(this.getSum(this._printData[id].milesUnitInfo));
                  }
                  break;
                case "Meters":
                  if (this._printData[id].geometryType !== "esriGeometryPoint") {
                    impactSummaryAggregatedValue =
                      dojoNumber.format(this.getSum(this._printData[id].metersUnitInfo), {
                        places: 2
                      });
                  } else {
                    impactSummaryAggregatedValue =
                      dojoNumber.format(this.getSum(this._printData[id].metersUnitInfo));
                  }
                  break;
                case "Kilometers":
                  if (this._printData[id].geometryType !== "esriGeometryPoint") {
                    impactSummaryAggregatedValue =
                      dojoNumber.format(this.getSum(this._printData[id].kilometersUnitInfo), {
                        places: 2
                      });
                  } else {
                    impactSummaryAggregatedValue =
                      dojoNumber.format(this.getSum(this._printData[id].kilometersUnitInfo));
                  }
                  break;
                case "Hectares":
                  if (this._printData[id].geometryType !== "esriGeometryPoint") {
                    impactSummaryAggregatedValue =
                      dojoNumber.format(this.getSum(this._printData[id].hectaresUnitInfo), {
                        places: 2
                      });
                  } else {
                    impactSummaryAggregatedValue =
                      dojoNumber.format(this.getSum(this._printData[id].hectaresUnitInfo));
                  }
                  break;
              }

              //if only point/line aoi then show N/A in area/length col
              if (this._aoiGraphicsLayer.graphics.length === 0) {
                summaryTableMeasurement = this.nls.reportsTab.notApplicableText;
              } else {
                if (impactSummaryAggregatedValue < 0.01 && impactSummaryAggregatedValue !== 0) {
                  summaryTableMeasurement = " < " + dojoNumber.format(0.01) + " ";
                } else {
                  summaryTableMeasurement = impactSummaryAggregatedValue;
                }
              }
              switch (this._printData[id].geometryType) {
                case "esriGeometryPoint":
                  impactArray = impactArray.concat(
                    impactSummaryAggregatedValue, this.nls.reportsTab.notApplicableText,
                    this.nls.reportsTab.notApplicableText);
                  break;
                case "esriGeometryPolygon":
                  // impactArray = impactArray.concat(
                  //   this._printData[id].featureCount, summaryTableMeasurement,
                  //   this.nls.reportsTab.notApplicableText);
                  impactArray = impactArray.concat(
                    this._printData[id].featureCount, this.nls.reportsTab.notApplicableText);
                  break;
                case "esriGeometryPolyline":
                  impactArray = impactArray.concat(
                    this._printData[id].featureCount, this.nls.reportsTab.notApplicableText,
                    summaryTableMeasurement);
                  break;
              }
            }
          }
        } else {

View solution in original post

0 Kudos
4 Replies
RobertScheitlin__GISP
MVP Emeritus

Martin,

   Well that took some digging... You will need to edit the widget.js _getProcessedPrintData:

Line 255 - 257 are the original but if this is one of those layer you need to hide the area for then replace with lines 258 - 259.  Also line 89 has to be remove for your specific layer as well. I did not write any evaluation code for you this is just showing what needs to change to remove the area column from the report.

    /**
     * This function is used to get the data needed for printing the report
     * @memberOf Screening/Widget
     */
    _getProcessedPrintData: function () {

      var dataForReport, areaOfInterestText, areaOfInterestValue, aoiTextTemplate,
        aoiText, printMap, id, unableToAnalyzeText, showUnableToAnalyzeText,
        summaryTableMeasurement;

      dataForReport = [];
      areaOfInterestText = this.nls.reportsTab.aoiInformationTitle;

      if (!domClass.contains(this.aoiFeetUnitAreaContainer, "esriCTHidden")) {
        areaOfInterestValue = this.aoiFeetUnitAreaContainer.innerHTML;
      } else if (!domClass.contains(this.aoiMilesUnitAreaContainer, "esriCTHidden")) {
        areaOfInterestValue = this.aoiMilesUnitAreaContainer.innerHTML;
      } else if (!domClass.contains(this.aoiMetersUnitAreaContainer, "esriCTHidden")) {
        areaOfInterestValue = this.aoiMetersUnitAreaContainer.innerHTML;
      } else if (!domClass.contains(this.aoiKilometersUnitAreaContainer, "esriCTHidden")) {
        areaOfInterestValue = this.aoiKilometersUnitAreaContainer.innerHTML;
      } else if (!domClass.contains(this.aoiHectaresUnitAreaContainer, "esriCTHidden")) {
        areaOfInterestValue = this.aoiHectaresUnitAreaContainer.innerHTML;
      }

      // Add AOI text on top of the report
      if (this.reportDijit.Date) {
        aoiTextTemplate =
          "<div class='esrCTAOIInfoDiv'>" +
          // Title
          "<div class='esriAOITitle'>" +
          "<input class='esriCTAOITitleInput' type='text' value='" + areaOfInterestText + "'>" +
          "</div>" +
          // Area
          "<div class='esriCTAOIArea'>" +
          "<input class='esriCTAOIInputArea' type='text' value='" + areaOfInterestValue + "'>" +
          "</div>" +
          // Date
          "<div class='esriCTPrintLocaleDateDiv'>" +
          "<input type='text' class='esriCTLocaleDateInputTitle' value='" +
          this._getDate() + "'>" +
          "</div>" +
          "</div>";
      } else {
        aoiTextTemplate =
          "<div class='esrCTAOIInfoDiv'>" +
          // Title
          "<div class='esriAOITitle'>" +
          "<input class='esriCTAOITitleInput' type='text' value='" + areaOfInterestText + "'>" +
          "</div>" +
          // Area
          "<div class='esriCTAOIArea'>" +
          "<input class='esriCTAOIInputArea' type='text' value='" + areaOfInterestValue + "'>" +
          "</div>" +
          "</div>";
      }

      aoiText = {
        title: "",
        type: "html",
        data: aoiTextTemplate
      };
      dataForReport.push(aoiText);

      //add Map at the top in the report
      printMap = {
        addPageBreak: true,
        type: "map",
        map: this.map,
        printTemplate: this._getPrintTemplate()
      };
      dataForReport.push(printMap);
      dataForReport.push({
        "type": "note",
        "addPageBreak": false
      });

      //Impact summary table
      var impactSummaryTable = {
        title: this.nls.reportsTab.summaryReportTitle,
        addPageBreak: false,
        type: "table",
        data: {
          "showRowIndex": false,
          "maxNoOfCols": 4,
          "rows": [],
          "cols": [this.nls.common.name,
          this._getAggregatedColTitle("esriGeometryPoint"),
          //this._getAggregatedColTitle("esriGeometryPolygon"),
          this._getAggregatedColTitle("esriGeometryPolyline")
          ]
        }
      };

      for (id in this._printData) {
        var data, reportTable, matchedIndex, temp, aggregatedObj, aggregatedId, impactArray,
          impactSummaryAggregatedValue, selectedUnitValue;
        data = this._printData[id].info;
        impactArray = [];
        // no results found
        if (data.rows && data.rows.length > 0) {
          // fields off
          // configure check && layer invisible
          if (data.cols && data.cols.length > 0) {
            impactArray = [data.title];
            matchedIndex = [];
            aggregatedObj = {};
            for (var i = 0; i < data.rows.length; i++) {
              //if current index is not found in matched index then search array of that index
              if (matchedIndex.indexOf(i) < 0) {
                temp = this._getArrayIndex(data.rows, data.rows[i]);
                aggregatedObj[i] = temp;
                matchedIndex = matchedIndex.concat(temp);
              }
              //if all index are matched break loop
              if (matchedIndex.length === data.rows.length) {
                break;
              }
            }
            var aggregatedData = {
              "showRowIndex": true,
              "rows": [],
              "cols": lang.clone(data.cols)
            };
            //based on selected unit add col
            aggregatedData.cols.push(this._getAggregatedColTitle(this._printData[id].geometryType));

            for (aggregatedId in aggregatedObj) {
              var newRowInaggregatedData = lang.clone(data.rows[parseInt(aggregatedId, 10)]);
              selectedUnitValue = this.analysisUnitSelect.get('value');

              switch (selectedUnitValue) {
                case "Feet":
                  newRowInaggregatedData.push(
                    this.getSum(this._printData[id].feetUnitInfo,
                      aggregatedObj[parseInt(aggregatedId, 10)]));
                  break;
                case "Miles":
                  newRowInaggregatedData.push(
                    this.getSum(this._printData[id].milesUnitInfo,
                      aggregatedObj[parseInt(aggregatedId, 10)]));
                  break;
                case "Meters":
                  newRowInaggregatedData.push(
                    this.getSum(this._printData[id].metersUnitInfo,
                      aggregatedObj[parseInt(aggregatedId, 10)]));
                  break;
                case "Kilometers":
                  newRowInaggregatedData.push(
                    this.getSum(this._printData[id].kilometersUnitInfo,
                      aggregatedObj[parseInt(aggregatedId, 10)]));
                  break;
                case "Hectares":
                  newRowInaggregatedData.push(
                    this.getSum(this._printData[id].hectaresUnitInfo,
                      aggregatedObj[parseInt(aggregatedId, 10)]));
                  break;
              }
              aggregatedData.rows.push(newRowInaggregatedData);
            }

            if (aggregatedData.rows && aggregatedData.rows.length > 0) {
              /*sort data in descending order so that rows for which measurement are not to be shown
              will be shifted to bottom*/
              aggregatedData.rows = aggregatedData.rows.sort(this._sortFeatureArray);
              //if last col in row have value 0 show N/A
              aggregatedData.rows = array.map(aggregatedData.rows,
                lang.hitch(this, this._setNotApplicableRows));

              aggregatedData = this._addCommaToAreaAndLengthColumn(aggregatedData, this._printData[id].geometryType);

              reportTable = {
                title: data.title,
                addPageBreak: false,
                type: "table",
                data: aggregatedData
              };
              dataForReport.push(reportTable);

              switch (selectedUnitValue) {
                case "Feet":
                  if (this._printData[id].geometryType !== "esriGeometryPoint") {
                    impactSummaryAggregatedValue =
                      dojoNumber.format(this.getSum(this._printData[id].feetUnitInfo), {
                        places: 2
                      });
                  } else {
                    impactSummaryAggregatedValue =
                      dojoNumber.format(this.getSum(this._printData[id].feetUnitInfo));
                  }
                  break;
                case "Miles":
                  if (this._printData[id].geometryType !== "esriGeometryPoint") {
                    impactSummaryAggregatedValue =
                      dojoNumber.format(this.getSum(this._printData[id].milesUnitInfo), {
                        places: 2
                      });
                  } else {
                    impactSummaryAggregatedValue =
                      dojoNumber.format(this.getSum(this._printData[id].milesUnitInfo));
                  }
                  break;
                case "Meters":
                  if (this._printData[id].geometryType !== "esriGeometryPoint") {
                    impactSummaryAggregatedValue =
                      dojoNumber.format(this.getSum(this._printData[id].metersUnitInfo), {
                        places: 2
                      });
                  } else {
                    impactSummaryAggregatedValue =
                      dojoNumber.format(this.getSum(this._printData[id].metersUnitInfo));
                  }
                  break;
                case "Kilometers":
                  if (this._printData[id].geometryType !== "esriGeometryPoint") {
                    impactSummaryAggregatedValue =
                      dojoNumber.format(this.getSum(this._printData[id].kilometersUnitInfo), {
                        places: 2
                      });
                  } else {
                    impactSummaryAggregatedValue =
                      dojoNumber.format(this.getSum(this._printData[id].kilometersUnitInfo));
                  }
                  break;
                case "Hectares":
                  if (this._printData[id].geometryType !== "esriGeometryPoint") {
                    impactSummaryAggregatedValue =
                      dojoNumber.format(this.getSum(this._printData[id].hectaresUnitInfo), {
                        places: 2
                      });
                  } else {
                    impactSummaryAggregatedValue =
                      dojoNumber.format(this.getSum(this._printData[id].hectaresUnitInfo));
                  }
                  break;
              }

              //if only point/line aoi then show N/A in area/length col
              if (this._aoiGraphicsLayer.graphics.length === 0) {
                summaryTableMeasurement = this.nls.reportsTab.notApplicableText;
              } else {
                if (impactSummaryAggregatedValue < 0.01 && impactSummaryAggregatedValue !== 0) {
                  summaryTableMeasurement = " < " + dojoNumber.format(0.01) + " ";
                } else {
                  summaryTableMeasurement = impactSummaryAggregatedValue;
                }
              }
              switch (this._printData[id].geometryType) {
                case "esriGeometryPoint":
                  impactArray = impactArray.concat(
                    impactSummaryAggregatedValue, this.nls.reportsTab.notApplicableText,
                    this.nls.reportsTab.notApplicableText);
                  break;
                case "esriGeometryPolygon":
                  // impactArray = impactArray.concat(
                  //   this._printData[id].featureCount, summaryTableMeasurement,
                  //   this.nls.reportsTab.notApplicableText);
                  impactArray = impactArray.concat(
                    this._printData[id].featureCount, this.nls.reportsTab.notApplicableText);
                  break;
                case "esriGeometryPolyline":
                  impactArray = impactArray.concat(
                    this._printData[id].featureCount, this.nls.reportsTab.notApplicableText,
                    summaryTableMeasurement);
                  break;
              }
            }
          }
        } else {
0 Kudos
MartinOwens1
Occasional Contributor II

Thanks Robert. Yeah it took me forever to find that area. I actually ended up doing an if else statment  for the lines that push the column titles and values:

 aggregatedData.cols.push(this._getAggregatedColTitle(this._printData[id].geometryType));

and this line:

selectedUnitValue = this.analysisUnitSelect.get('value');

and used the title to be able to skip those layers

      if(data.title === "Nearest Park" || data.title === "Countywide Soil Preservation Map" || data.title === "Inset Maps")

0 Kudos
KrisRobbins2
New Contributor II

Martin...could you possibly elaborate on this a  little further?  I need to completely remove the Area and Length calculations for all features in the report but am new to working with the code directly.

Any help would be much appreciated.

0 Kudos
MartinOwens1
Occasional Contributor II
 

KrisRobbins2  my purpose was to only remove the area and length from certain layers in the report. For what you're asking for you just need to comment out a bunch of code:

 

      //Impact summary table
      var impactSummaryTable = {
        title: this.nls.reportsTab.summaryReportTitle,
        addPageBreak: false,
        type: "table",
        data: {
          "showRowIndex": false,
          "maxNoOfCols": 4,
          "rows": [],
          "cols": [this.nls.common.name/* ,
          this._getAggregatedColTitle("esriGeometryPoint"),
          this._getAggregatedColTitle("esriGeometryPolygon"),
          this._getAggregatedColTitle("esriGeometryPolyline") */ ]
        }
      };

      for (id in this._printData) {
        var data, reportTable, matchedIndex, temp, aggregatedObj, aggregatedId, impactArray,
          impactSummaryAggregatedValue, selectedUnitValue;
        data = this._printData[id].info;
        impactArray = [];
        // no results found
        if (data.rows && data.rows.length > 0) {
          // fields off
          // configure check && layer invisible
          if (data.cols && data.cols.length > 0) {
            impactArray = [data.title];
            matchedIndex = [];
            aggregatedObj = {};
            for (var i = 0; i < data.rows.length; i++) {
              //if current index is not found in matched index then search array of that index
              if (matchedIndex.indexOf(i) < 0) {
                temp = this._getArrayIndex(data.rows, data.rows[i]);
                aggregatedObj[i] = temp;
                matchedIndex = matchedIndex.concat(temp);
              }
              //if all index are matched break loop
              if (matchedIndex.length === data.rows.length) {
                break;
              }
            }
           var aggregatedData = {
              "showRowIndex": true,
              "rows": [],
              "cols": lang.clone(data.cols)
            };
            //based on selected unit add col
           // aggregatedData.cols.push(this._getAggregatedColTitle(this._printData[id].geometryType));
            for (aggregatedId in aggregatedObj) {
              var newRowInaggregatedData = lang.clone(data.rows[parseInt(aggregatedId, 10)]);
			  /* selectedUnitValue = this.analysisUnitSelect.get('value');
              switch (selectedUnitValue) {
                case "Feet":
                  newRowInaggregatedData.push(
                    this.getSum(this._printData[id].feetUnitInfo,
                      aggregatedObj[parseInt(aggregatedId, 10)]));
                  break;
                case "SquareFeet":
                  newRowInaggregatedData.push(
                    this.getSum(this._printData[id].squareFeetUnitInfo,
                      aggregatedObj[parseInt(aggregatedId, 10)]));
                  break;
                case "Miles":
                  newRowInaggregatedData.push(
                    this.getSum(this._printData[id].milesUnitInfo,
                      aggregatedObj[parseInt(aggregatedId, 10)]));
                  break;
                case "Acres":
                  newRowInaggregatedData.push(
                    this.getSum(this._printData[id].acresUnitInfo,
                      aggregatedObj[parseInt(aggregatedId, 10)]));
                  break;
                case "Meters":
                  newRowInaggregatedData.push(
                    this.getSum(this._printData[id].metersUnitInfo,
                      aggregatedObj[parseInt(aggregatedId, 10)]));
                  break;
                case "SquareMeters":
                  newRowInaggregatedData.push(
                    this.getSum(this._printData[id].squareMetersUnitInfo,
                      aggregatedObj[parseInt(aggregatedId, 10)]));
                  break;
                case "Kilometers":
                  newRowInaggregatedData.push(
                    this.getSum(this._printData[id].kilometersUnitInfo,
                      aggregatedObj[parseInt(aggregatedId, 10)]));
                  break;
                case "SquareKilometers":
                  newRowInaggregatedData.push(
                    this.getSum(this._printData[id].squareKilometersUnitInfo,
                      aggregatedObj[parseInt(aggregatedId, 10)]));
                  break;
                case "Hectares":
                  newRowInaggregatedData.push(
                    this.getSum(this._printData[id].hectaresUnitInfo,
                      aggregatedObj[parseInt(aggregatedId, 10)]));
                  break;
                case "SquareMiles":
                  newRowInaggregatedData.push(
                    this.getSum(this._printData[id].squareMilesUnitInfo,
                      aggregatedObj[parseInt(aggregatedId, 10)]));
                  break;
                case "Count":
                  newRowInaggregatedData.push(
                    this.getSum(this._printData[id].countUnitInfo,
                      aggregatedObj[parseInt(aggregatedId, 10)]));
                  break;
              } */
              aggregatedData.rows.push(newRowInaggregatedData);
            }
            if (aggregatedData.rows && aggregatedData.rows.length > 0) {
              /*sort data in descending order so that rows for which measurement are not to be shown
              will be shifted to bottom*/
              aggregatedData.rows = aggregatedData.rows.sort(this._sortFeatureArray);
              //if last col in row have value 0 show N/A
              aggregatedData.rows = array.map(aggregatedData.rows,
                lang.hitch(this, this._setNotApplicableRows));

              aggregatedData = this._addCommaToAreaAndLengthColumn(aggregatedData, this._printData[id].geometryType);

              reportTable = {
                title: data.title,
                addPageBreak: false,
                type: "table",
                data: aggregatedData
              };
              dataForReport.push(reportTable);

              /* switch (selectedUnitValue) {
                case "Feet":
                  if (this._printData[id].geometryType !== "esriGeometryPoint") {
                    impactSummaryAggregatedValue =
                      dojoNumber.format(this.getSum(this._printData[id].feetUnitInfo), { places: 2 });
                  } else {
                    impactSummaryAggregatedValue =
                      dojoNumber.format(this.getSum(this._printData[id].feetUnitInfo));
                  }
                  break;
                 case "Miles":
                  if (this._printData[id].geometryType !== "esriGeometryPoint") {
                    impactSummaryAggregatedValue =
                      dojoNumber.format(this.getSum(this._printData[id].milesUnitInfo), { places: 2 });
                  } else {
                    impactSummaryAggregatedValue =
                      dojoNumber.format(this.getSum(this._printData[id].milesUnitInfo));
                  }
                  break; 
                case "Meters":
                  if (this._printData[id].geometryType !== "esriGeometryPoint") {
                    impactSummaryAggregatedValue =
                      dojoNumber.format(this.getSum(this._printData[id].metersUnitInfo), { places: 2 });
                  } else {
                    impactSummaryAggregatedValue =
                      dojoNumber.format(this.getSum(this._printData[id].metersUnitInfo));
                  }
                  break;
                case "Kilometers":
                  if (this._printData[id].geometryType !== "esriGeometryPoint") {
                    impactSummaryAggregatedValue =
                      dojoNumber.format(this.getSum(this._printData[id].kilometersUnitInfo), { places: 2 });
                  } else {
                    impactSummaryAggregatedValue =
                      dojoNumber.format(this.getSum(this._printData[id].kilometersUnitInfo));
                  }
                  break;
                case "Hectares":
                  if (this._printData[id].geometryType !== "esriGeometryPoint") {
                    impactSummaryAggregatedValue =
                      dojoNumber.format(this.getSum(this._printData[id].hectaresUnitInfo), { places: 2 });
                  } else {
                    impactSummaryAggregatedValue =
                      dojoNumber.format(this.getSum(this._printData[id].hectaresUnitInfo));
                  }
                  break;
              } 

              //if only point/line aoi then show N/A in area/length col
              if (this._aoiGraphicsLayer.graphics.length === 0) {
                summaryTableMeasurement = this.nls.reportsTab.notApplicableText;
              } else {
                if (impactSummaryAggregatedValue < 0.01 && impactSummaryAggregatedValue !== 0) {
                  summaryTableMeasurement = " < " + dojoNumber.format(0.01) + " ";
                } else {
                  summaryTableMeasurement = impactSummaryAggregatedValue;
                }
              }
               switch (this._printData[id].geometryType) {
                case "esriGeometryPoint":
                  impactArray = impactArray.concat(
                    impactSummaryAggregatedValue, this.nls.reportsTab.notApplicableText,
                    this.nls.reportsTab.notApplicableText);
                  break;
                case "esriGeometryPolygon":
                  impactArray = impactArray.concat(
                    this._printData[id].featureCount, summaryTableMeasurement, 
                    this.nls.reportsTab.notApplicableText);
                  break;
                case "esriGeometryPolyline":
                  impactArray = impactArray.concat(
                    this._printData[id].featureCount, this.nls.reportsTab.notApplicableText ,
                    summaryTableMeasurement);
                  break;
              } */
            }
          }
        } else {
/*           impactArray = [data.title];
		  
          //check if layer is not analyzed
          if (this._printData[id].isExceedingMaxRecordCount) {
            showUnableToAnalyzeText = true;
            //show * in layer title if exceeding max records
            impactArray[0] += " *";
            //in case of unable to analyze show blank in area/length col
            impactSummaryAggregatedValue = "";
          } else {
            //if only point/line aoi then show N/A in area/length col
            if (this._aoiGraphicsLayer.graphics.length === 0) {
              impactSummaryAggregatedValue = this.nls.reportsTab.notApplicableText;
            } else {
              impactSummaryAggregatedValue = 0;
            }
          }
		  
		  
           switch (this._printData[id].geometryType) {
            case "esriGeometryPoint":
              impactArray = impactArray.concat(this._printData[id].featureCount,
                this.nls.reportsTab.notApplicableText, this.nls.reportsTab.notApplicableText);
              break;
            case "esriGeometryPolygon":
              impactArray = impactArray.concat(this._printData[id].featureCount,
                 impactSummaryAggregatedValue,  this.nls.reportsTab.notApplicableText);
              break;
            case "esriGeometryPolyline":
              impactArray = impactArray.concat(this._printData[id].featureCount,
                this.nls.reportsTab.notApplicableText ,  impactSummaryAggregatedValue  );
              break;
          }  */
        }
        if (impactArray && impactArray.length > 0) {
          impactSummaryTable.data.rows.push(impactArray);
        }
      }
      //add impact summary table after map in report
      if (showUnableToAnalyzeText) {
        // Add unable to analyze text in report only if layer(s) not analyzed
        unableToAnalyzeText = {
          title: "",
          type: "html",
          data: "<div class='esriCTUnableToAnalyzeText'> * " +
            this.nls.reportsTab.unableToAnalyzeText + "</div>"
        };
        dataForReport.splice(3, 0, impactSummaryTable, unableToAnalyzeText);
      } else {
        dataForReport.splice(3, 0, impactSummaryTable);
      }
      return dataForReport;
    },

 

 

 

 

 

 

0 Kudos