0 Replies Latest reply on Oct 27, 2009 10:53 AM by socialtravesty

    Grouping and Summaries in ADG using HTTPServices?

    socialtravesty

      I am pretty new to flex, though am quickly coming to appreciate its form/charting abilities for dashboards.  I have been working on some ADGs for weeks and cannot get them to group and summary via MXML when using an httpservice.  If i remove the groupings then data displays fine.  If i put them back in, no data.  I have tried to get around this using AS, but having a lot of difficulty there.  I am sure that I am missing something with reading in my XML.

       

      Here is the sample XML - output is via php

       

      <databases>
      <database server_name="CLK-SQL01" dbname="DYNAMICS" backup_mb="60.0767" cost="0.295261" />
      <database server_name="CLK-SQL01" dbname="TCLAR" backup_mb="154.0708" cost="0.757015" />
      <database server_name="CLK-SQL01" dbname="TWO" backup_mb="263.0864" cost="1.292207" />
      <database server_name="CLK-SQL01" dbname="CLARK" backup_mb="159.0806" cost="0.781662" />
      <database server_name="CLK-SQL01" dbname="TMW_Clark" backup_mb="136.0791" cost="0.668487" />
      <database server_name="NT-SQLVM3" dbname="msdb" backup_mb="5.8921" cost="0.029174" />
      <database server_name="NT-SQLVM3" dbname="DHLMXTEST-old" backup_mb="124.0806" cost="0.609636" />
      <database server_name="NT-SQLVM3" dbname="master" backup_mb="2.9536" cost="0.014587" />
      <database server_name="NT-SQLVM3" dbname="model" backup_mb="1.2671" cost="0.006036" />
      <database server_name="NT-SQLVM3" dbname="msdb" backup_mb="61.1694" cost="0.300291" />
      <database server_name="NT-SQLVM3" dbname="DHLCA" backup_mb="393.0864" cost="1.931017" />
      <database server_name="NT-SQLVM3" dbname="DHLCATEST" backup_mb="90.0786" cost="0.44264" />
      <database server_name="NT-SQLVM3" dbname="TFW" backup_mb="87.0786" cost="0.42755" />
      <database server_name="NT-SQLVM3" dbname="DHL_AMS" backup_mb="9.2788" cost="0.045773" />
      <database server_name="NT-SQLVM3" dbname="DHLMX" backup_mb="1290.1528" cost="6.337297" />
      <database server_name="NT-SQLVM3" dbname="DHLMXTEST" backup_mb="863.0786" cost="4.239787" />

      <databases>

       

      Here is my MXML:

       

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%" creationComplete="getBAKs.send()">

       

      <mx:HTTPService id="getBAKs" url="http://10.10.80.15/db_list.php" resultFormat="e4x" />

       

      <mx:AdvancedDataGrid id="dbbakList" width="100%" height="100%" horizontalCenter="0" verticalCenter="0" initialize="dbData.refresh()">
      <mx:dataProvider>
           <mx:GroupingCollection id="dbData" source="{getBAKs.lastResult.databases.database}">
               <mx:Grouping>
                   <mx:GroupingField name="server_name">
                       <mx:summaries>
                           <mx:SummaryRow summaryPlacement="group">
                               <mx:fields>
                                   <mx:SummaryField dataField="backup_mb" operation="SUM" />
                                   <mx:SummaryField dataField="cost" operation="SUM" />
                               </mx:fields>
                           </mx:SummaryRow>
                       </mx:summaries>
                   </mx:GroupingField>
               </mx:Grouping>
           </mx:GroupingCollection>
      </mx:dataProvider>
      <mx:columns>
        <mx:AdvancedDataGridColumn headerText="DB Name" dataField="dbname" />
        <mx:AdvancedDataGridColumn headerText="Backup Size (MB)" dataField="backup_mb" />
        <mx:AdvancedDataGridColumn headerText="Backup Cost" dataField="cost"/>
       
      </mx:columns>
      </mx:AdvancedDataGrid>

       

      </mx:Canvas>

       

      Am I missing something?