troubleshooting Question

Export Flash Builder As3 arrayCollection as csv in the AC original order.

Avatar of aduvall
aduvall asked on
PHPApache Flex
2 Comments1 Solution1396 ViewsLast Modified:
I have an ArrayCollection that I am trying to save to a folder on a web server to csv.

I don't mind using a combination of AS3 and PHP to accomplish this. I tried first sending the data as XML to a php script (magicparser) and then converting it to CSV but I could not get it to work as the csv was not in the order that it was originally in the ArrayCollection. I would like to know how to get this in it's proper order.

 If the CSV can be generated from Flex then auto uploaded to the server for further processing that would be fine as well.


This is how the CSV file should look
H,TUS test,TUS test,02/8/2012,TUS test,1234567890,555,05/19,Visa,
D,MBE37602SH,MBE37602SH,4,EA,54.41,345678,2/8/2012,,
D,MBE37602SH,MBE37602SH,4,EA,54.41,345678,2/8/2012,,

This is what I get


   ,TUS TEST,05/19,Visa,,TUS TEST,555,1234567890,02/8/2012,H,TUS test
  ,MBE37602SH,2/8/2012,,,MBE37602SH,345678,54.41,4,D,EA
 ,MBE37602SH,2/8/2012,,,MBE37602SH,345678,54.41,4,D,EA

This is the ArrayCollection

private var items:ArrayCollection = new ArrayCollection([
{type:"H", cnum:"TUS TEST", fg:"TUS TEST", qty:"02/8/2012", uom:"TUS test", price:"1234567890", po:"555", ddate:"05/19", efield:"Visa", ffield:""},
{type: "D", cnum:"MBE37602SH", fg:"MBE37602SH", qty:"4", uom:"EA", price:"54.41", po:"345678", ddate:"2/8/2012", efield:"", ffield:""},
{type: "D", cnum:"MBE37602SH", fg:"MBE37602SH", qty:"4", uom:"EA", price:"54.41", po:"345678", ddate:"2/8/2012", efield:"", ffield:""}]);
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros