Displaying an Excel File

Topics: Prism v2 - Silverlight 2
May 20, 2009 at 8:04 PM



I am relatively new to Silverlight/Prism.  Is there any way to display an Excel file from a Composite Silverlight app?

For instance, if I have a reference to an Excel file related to each specific row of a grid and the user clicks on it can I pop up a view of the Excel file?  (For example, in the News module of the StockTraderRI sample application, clicking on a specific news article the user has the option of displaying that article in a pop up window).

Perhaps there is a way to do this by creating a custom control via the Silverlight Toolkit?

Many thanks,

- Rich

May 22, 2009 at 8:02 PM

Hi Rich,


It’s great that you are starting to use the Composite Application Guidance for WPF & Silverlight. I hope you are liking it.


Prism allows you to create regions and show them as a popup. As you said, an example of that can be found at RI sample.


Regarding showing an Excel files there are some things to notice:

·         The first issue is that you won't be able to show/read an excel file if the file resides in the client machine , so you would only be able to access those in the isolated storage, assuming there are any.

·         There is no control that can show an excel file with all the full features. You might use a simple datagrid to show excels rows, Silverlight graphics to redraw excels charts, etc. There are might be also third party controls that provides enhanced functionality.

·         One other option (depending on what scenario you have in mind), is providing a simple file download instead of a popup. If you set the right mimeType (application/msexcel), the browser will try to open the file in Excel automatically. These will  allow you to show the excel file and allow the user to modify the file contents, but you won't have control over those modifications.


Hope it helps!


Matias Bonaventura