Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Binding Data through function module in adobe to display charts

Former Member
0 Likes
654

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

4 REPLIES 4
Read only

athavanraja
Active Contributor
0 Likes
634

option 1. Consume the RFC as a webservice from flex as told in this thread

(its your thread, you should atleast say thanks if that helped you and close that thread)

options 2: write a BSP which returns the data in xml format and then use mx:HTTPService on the flex side to get the data

Raja

Read only

Former Member
0 Likes
634

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.

Read only

0 Likes
634

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.

Read only

0 Likes
634

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:

http://www.partlyhuman.com/blog/roger/as3-e4x-rundown