The No.1 i-Technology Magazine in the World !
   
 

      ES no BS
       My son's animations and music            training         Twitter                       Америчка

Archives

««Jul 2009»»
SMTWTFS
    1234
567891011
12131415161718
19202122232425
262728293031

RSS Feed








Subscribe to these blogs

We've taught Adobe Flex to talk to Microsoft Excel

posted Monday, 18 September 2006

We are finishing writing our book on RIA with Flex and Java , and the last chapter is called "Integration with External Applications".  It's sixty five pages of some advanced read. After writing this chapter one of us suggested that it would be easier to re-write Excel from scratch. It's not straightforward coding, but the results are good. After covering some basics  about ExternalInterface and how it enables bi-directional communications between JavaScript inside HTML page and embedded Flex application, this chapter leads you through jungles of Flash technologies such as External API and LocalConnection as well as through maze of Microsoft old timers like ADODB and OWC. We have been coding in VBA, JavaScript, XSLT, not to mention the ActionScript, of course.

We've also provided the code for  a more complex example of integration with external applications, namely Microsoft Excel. These days the data entry or analytical applications with no Excel integration are simply hard to find. Be that saving of data in native Excel format or CSV, accepting data entered in Excel or dynamically creating Excel Charts based on the database queries – we see it everywhere. Microsoft Excel is one of the most popular business applications ever .

This  solution involves two ActiveX objects embedded in an HTML page with instant as well as on demand data synchronization between the objects. One of these ActiveX objects is the Flash Player control, executing Flex application. The second ActiveX is a Spreadsheet from Microsoft Office Web Components (OWC). You may think about Spreadsheet as of miniature Microsoft Excel application running inside the HTML page.

Disclaimer: This particular sample works under IE in  Windows XP, but has some issues on Windows 2000. I'm sure, if you are still running Window 98 you may face some issues as well, which we'll be happy to fix for its customers. If you do not see the spreadsheet while running this example, most likely you do not have OWC installed - get it from this site .

Meanwhile try to make changes in the left (Flex) and right  (Excel) spreadsheets and the data should be replicated back and forth.  We'd appreciate any suggestions/critique of this application.

Application like this opens the doors to some interesting project ideas: we also know how to generate and execute formulas on the fly, provide proper reporting and printing, and more. But that's later. Let's finish the book first.

 

tags:                

links: digg this    del.icio.us    technorati    




1. Dav left...
Tuesday, 17 April 2007 12:40 pm

It's possible to get the source of this very nice implementation ?


2. Yakov Fain left...
Tuesday, 17 April 2007 1:34 pm

Get our book at www.theriabook.com - we've described the Flex/Excel connectivity in great details there and included all code samples.


3. kanu left...
Tuesday, 17 July 2007 6:38 am :: http://kanukukreja.blogspot.com

But your books are not availabel in India.... so from where we can have the code for such a nice application.


4. kanu left...
Tuesday, 17 July 2007 6:54 am :: http://kanukukreja.blogspot.com

what if there is no MS-office installed on my system, then this application won't work :(


5. Yakov Fain left...
Tuesday, 17 July 2007 4:30 pm

@kanu

1. The source code is available on the book's site 2. The publisher sends the book all over the world plus you get free PDF of the book immediately as you pay 3. Microsoft Office Components come with Microsoft Office, or they can be downloaded separately from the following Web site: http://www.microsoft.com/downloads/details.aspx?FamilyID=982B0359-0A86-4FB2 -A7EE-5F3A499515DD&displaylang=EN


6. Darren Bishop left...
Sunday, 9 September 2007 3:19 am

Is it possible to just use the Spreadsheet component (OWC) as an embedded Excel/spreadsheet engine i.e. formulae evaluator, frontend by Flex?

I would be interested in buying the book if I know my requirements can be satisfied with this approach


7. Yakov Fain left...
Sunday, 9 September 2007 8:49 am

@Darren The answer is yes. Since you have access to spreadsheets formulas you can use OWC spreadsheet and pass the results of calulations stored in a particular cell back to Flex.

On the side note, we have a Web reporter written in Flex that includes our own formula engine. If you'll watch this demo http://www.myflex.org/screencast/clearbi_ajax/clearbi_ajax.html you'll see that we use formulas in our report editor.