‎2008 Jan 12 6:20 AM
Hello Gurus,
This is the requirement :-
Through function module output i have to display the chart.
For ex:-In sales order transaction there is a field called status.For every order there is status (open, complete, inprocess). Display the chart based on the order status that how many open, complete and inprocess are there.
Thanks,
Karan
‎2008 Jan 12 9:10 AM
‎2008 Mar 18 3:30 PM
continuing the above option just write a logic by comparing the strings in XML data(xml data handles acts as dataprovider for comparing strings) and increase the count.Finally handle the count in array and take that array as dataprovider to chart.
‎2008 Apr 23 4:08 PM
Hi,
As i said continuing with above steps handle data in XML object (here in code xmldata).then compare the status you need with xmldata and take status count.see the code
Finally this array can useful for chart.
[Bindable] public var StatusArray:ArrayCollection = new ArrayCollection();
public function getChartValueOfOrder():void{
var openVal:Number = 0;
var completeVal:Number = 0;
var inprocessVal:Number = 0;
StatusArray.removeAll();
for(var i:int= 0 ;i<xmldata.dataProvider.length;i++){
if(xmldata.dataProvider<i>.overAllStatus.toString() == 'open'){
openVal++;
}
else if(xmldata.dataProvider<i>.overAllStatus.toString() == 'complete'){
completeVal++;
}
else if(xmldata.dataProvider<i>.overAllStatus.toString() == 'inprocess'){
inprocessVal++;
}
var objStatus:Object = ;
StatusArray.addItem(objStatus);
}
Thanks.i hope this help you.
‎2008 May 02 5:18 PM
Just to provide a bit more color, a more actionscript way of doing this is to use E4X:
openVal = (xmldata.dataProvider.(overAllStatus == 'open')).length;
Here is some info about E4X, if you are doing lots of XML parsing with actionscript knowing how to use E4X will save you tons of time: