Saturday, January 5, 2013

How to Import Excel Data into Silverlight App for Visualization?

How to Import Excel Data into Silverlight App for Visualization?

Im building an Silverlight Application (Silverlight 4, Visual Studio 2010), in which the user can generate Charts (line-Charts, Bar Chart) dynamically, by entering a specific time period.

At the Moment i have no idea how to import the data to Silverlight, to generate the Charts. My data is stored in 4 Excel Tables and i have no clue what would be the best way to get that data into Silverlight?

I read a lot of examples using SQL Server as Database, but unfortunatly SQL Server is no choice for me.

Any help would be great!

Answers & Comments...

Answer: 1

Without relying too much on what is on the client side, you could upload the XLS files to your server, open them, parse them, and make the raw data available to your app via web service/WCF or which-ever other back-end you prefer.

by : Judyhttp://stackoverflow.com/users/61605

Answer: 2

A Silverlight 4 app with elevated permissions can do COM interop to talk to Excel (create / read / edit worksheets, etc.) using System.Windows.Interop and System.Runtime.InteropServices.Automation

dynamic excel = AutomationFactory.CreateObject("Excel.Application");             excel.Visible = true; dynamic workbook = excel.workbooks;             workbook.Add();             dynamic sheet = excel.ActiveSheet; dynamic range; range = sheet.Range("A1");             range.Value = "Hello World!"; 

You'll lose cross-platform compatibility, though -- this won't work on a Mac.

by : Schemerhttp://stackoverflow.com/users/324101

Answer: 3

Check this article, Ulf:

"Silverlight Interoperability with Excel" http://www.silverlight.net/community/samples/silverlight-samples/silverlight-interoperability-with-excel-35480/

by : Sergei Golubevhttp://stackoverflow.com/users/1420426




No comments:

Post a Comment

Send us your comment related to the topic mentioned on the blog