Hi FlexCoders, I have recently discovered the wonders of developing RIAs with Flex / FlexBuilder and have completely decided to use the same in further development efforts on my part. With a little .NET knowledge, I decided to venture out on the path of Flex by combining it with some wisdom I gained from developing using .NET.
As I have been working a lot on business and data driven application, I tried to re-create one screen of an application which I have previously done in ASP.Net into Flex. Nothing really fancy, just a simple screen which contains a datagrid listing of some parts references, with basic CRUD capabilities, sort and filter, and generation of report to print out the listing. With tremendous resources coming from this group, I was able to accomplish a little application which does what I first intended to do: 1. Display data in a datagrid control. 2. Provide sort (built-in to the datagrid) and search and filter mechanism to the datagrid. 3. Provide basic CRUD capabilities to the application. 4. Generating a report for the datagrid. Take note that the context of my application is a simple Flex on the front end, connnecting to a .NET webservice on the backend (for data/CRUD facilities/reporting facilities). The SWF application is simply embedded on an HTML page (copying the HTML generated from the FlexBuilder IDE). I was able to utilize the webservice, combined with Crystal Report (which comes built-in in Visual Studio) to create a report of the list which the application displays. The report is processed and a PDF file is generated which I am opening with the Flex application via an ExternalInterface javascript call to open the said PDF file report in another browser window. The way I was able to accomplish this is a bit of a hack. What I did was in my datagrid's provider, which is an ArrayCollection, I created a string, which is delimited by special characters to denote a field/column entry. For Example I have the following data on my ArrayCollection: ID Description 01 Lakers 02 Magic 03 Nuggets 04 Cavaliers 05 Celtics What I did was then parse this data into a delimited string such that my string variable would look like: 01|Lakers||02|Magic||03|Nuggets||04|Cavaliers||05|Celtics|| This string, can be easily parsed in .NET using some simple string functions and be pushed to a Crystal Report document, to generate the desired report. I feel that this is probably not the "BEST" way of doing this. I tried initially to pass an XML delimmited string, but .NET seems to read XML differently(?) from Flex. I would certainly appreciate any comments and suggestions on the way to achieve this properly. I am a bit lost on the XML data interchange between .NET and Flex. I am looking to use the ArrayCollection but I am still uncertain on what/how I would match it with the .NET data type. Looking forward to your inputs. Thanks and appreciating this group a lot, Angelo