3 Replies Latest reply on May 23, 2012 11:12 PM by Shripad_joshi

    OLAPResult as a dataprovider for AdvancedDataGrid cat it be?

    m-r-m-2-0-9-0

      Hi all,

      Is there a way to convert OLAPDataGrid to AdvancedDataGrid?

      I wonder if it is possible to build a dynamic ArrayCollection based on an OLAPResult object? I need to represent a result from an OLAP query into an ArrayCollection or anything else that can be used as a dataprovider for AdvancedDataGrid.

       

      If possible, does anyone have any idea on how to?

       

      Any comment is welcommed..

       

      Thanks

        • 1. Re: OLAPResult as a dataprovider for AdvancedDataGrid cat it be?
          cjolif-Fc6gNO

          What about using OLAPDataGrid instead of ADG?

           

          Christophe

           

           

           

           

          From:

          m-r-m-2-0-9-0 <forums@adobe.com>

          To:

          Christophe Jolif/France/IBM@IBMFR

          Date:

          08/26/2009 03:18 PM

          Subject:

          OLAPResult as a dataprovider for AdvancedDataGrid cat

          it be?

           

           

           

           

          Hi all,

          Is there a way to convert OLAPDataGrid to AdvancedDataGrid?

          I wonder if it is possible to build a dynamic ArrayCollection based on an

          OLAPResult object? I need to represent a result from an OLAP query into an

          ArrayCollection or anything else that can be used as a dataprovider for

          AdvancedDataGrid.

           

          If possible, does anyone have any idea on how to?

           

          Any comment is welcommed..

           

          Thanks

          • 2. Re: OLAPResult as a dataprovider for AdvancedDataGrid cat it be?
            m-r-m-2-0-9-0 Level 1

            Hi Christophe,

            thank u for the reply..

            I want to use ADG to show OLAP data as simple table (i.e. no drill up no drill down .. etc) so I can benefit from features of ADG like sorting, moving columns etc.

             

            are such features implemntable by ODG?

             

            thankx again

            mrm

            • 3. Re: OLAPResult as a dataprovider for AdvancedDataGrid cat it be?
              Shripad_joshi

              Hi all,

              I am also looking for the same technique you need to implement for your problem. I just found a method to convert the OLAP Result into arrayCollection...

              hope this may help you..

               

              private function onCubeQueryResult(event:Object, token:Object):void                              {

               

                                                      var tempCubeData:OLAPResult = event as OLAPResult;

                                                      if (!(tempCubeData is OLAPResult))

                                                                return;

               

                                                      var colAxis:IOLAPQueryAxis = tempCubeData.query.getAxis(OLAPQuery.COLUMN_AXIS);

                                                      var columnLength:Number = tempCubeData.getAxis(OLAPQuery.COLUMN_AXIS).positions.length;

                                                      var rowAxis:IOLAPQueryAxis = tempCubeData.query.getAxis(OLAPQuery.ROW_AXIS);

                                                      var rowLength:Number = tempCubeData.getAxis(OLAPQuery.ROW_AXIS).positions.length;

                                                      var newChartData:Array = [];

                                                      for(var j:int = 0; j < rowLength; j++) {

                                                                     for (var i:int=0;i<columnLength;i++) {

                                                                                    var tuple:OLAPTuple = colAxis.tuples[i];

                                                                                    var key:String = tuple.explicitMembers.toArray().join(",");

                                                                                   if (key.indexOf("(All)") > -1) continue;

                                                                                    newChartData.push({key:key, value:tempCubeData.getCell(j, i).value});

                                                                     }

                                                      }

              var chartData:ArrayCollection = new ArrayCollection(newChartData);

              }