1 Reply Latest reply on Feb 23, 2009 2:49 AM by MrFork

    Summary Row

    MrFork Level 1
      I'm trying to dynamically add summary fields into my summary row however I do not know how to add multiple Summary fields into the summary row. I have posted the code I'm using at the moment but obviously as expected it only adds one Field, the last one in the loop.

      I have tried created an array of summary fields then adding to the row but this throws a coersion type error.

      Im assuming something like sr.fields.push[sf]; (throws error)

      for (var i:int= 0; i<myADG.columnCount; i++)
      {
      var sf:SummaryField = new SummaryField (myADG.columns .headerText);
      sf.operation = "SUM";
      sr.fields = [sf];
      }
        • 1. Re: Summary Row
          MrFork Level 1
          var array:Array = new Array
          for (var i:int= 0; i<myADG.columnCount; i++)
          {
          var sf:SummaryField = new SummaryField (myADG.columns .headerText);
          sf.operation = "SUM";
          array.push(sf);
          }

          sr.fields = array;

          Ok, I've worked out the code.

          Craig