views:

448

answers:

3

Hi there,

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!

A: 

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.

Ryan Bates
A: 

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.

Schemer
A: 

Check this article, Ulf:

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

Sergei Golubev