I have data in excel 2007 spreadsheet in a server, I want to convert the excel data into XML, which is used in the Flex front-end for displaying at the client side. Also, I want to do few calculations during the display of the excel data. Can anyone give me idea how to implement this?
I have decided to place the excel spreadsheet at server side and deploy a java server application using POI in a web container in the same server. When I execute the flex application at client side, it will connect to java application at server side. The java application will convert the data from excel to XML , then the flex code will use the XML data for display. Will this approach work for me? Do you have any other suggestion, please reply to me.
Thanks for your reply. As you said, this is truly a high level design. However, I want to go bit low level. My Question is...When I generate XML at server side, where should I keep the XML to make use of it in FLEX at client side. It should be either at client side or at server side? If I keep the XML at server side, then the flex will connect to server for each client request (even if it is a small operation). On the other side, to keep the XML at client side, what will be the best way to send the whole XML to each requested clients? When I keep the XML at client side, it will be easy for FLEX to get and display the data. Can you please give me any suggestion where should I keep the server generated XML file?
author and jackaroo
As a general rule, you probably want to push the bare minimum amount of data over to the client. If all you were doing was displaying the data, you might choose to send only enough information needed to display a screen's worth of data. If you decide to go down a thick-client route, you might increase that to all the rows needed to display a screen's worth of data (assuming that you are calculating data on a row-by-row basis).
Joined: Feb 20, 2010
Thanks again for your update. I have deployed a java web application in tomcat server. Also, My Excel file has been placed in the same server in a physical path. I have to connect with the java object in the server when I execute the FLEX ( swf file) from client side. I am using Flex 3 and tomcat 7. The java object, which is in the server, will use POI API to read Excel spreadhsheet and convert it into XML file at very first time.
For the rest of the flex request, the corresponding java object will process the XML data and send necessary data to Client (Flex). Do you have any idea how does the Flex interact with the Java code? Do you have any efficient way to implement this?
author and jackaroo
Personally I like to use REST - using Jersey it is simple to create an API that can be consumed by many clients. The only problem is that (at least in Flex 3) the communication is limited to GET and POST (no PUT or DELETE). This may not be a problem for you - you can workaround these problems by adding parameters to your POST, or use something like restHttpService).
A lot of people using Flex and Java prefer to use BlazeDS. My understanding is that this is not quite as open, but it may be an easier route.