Does Silverlight 3 have access to local file system, Open Excel, and print reports?

Tony_Henrich picture Tony_Henrich · Jul 18, 2009 · Viewed 10k times · Source

I was wondering if Silverlight 3 can be used to create line of business applications where I can use file import/export facilities, read an xls file and open Excel, use a report tool like Crsytal Reports or Reporting Services or.. is WPF needed?

I am new to Silverlight and WPF and want to decide if I can skip learning WPF. I know Silverlight is a subset of WPF but I just want to concentrate in one of the two.

Answer

Sorskoot picture Sorskoot · Jul 20, 2009

Although Silverlight is sand-boxed and it isn't possible to open and save files to the local file system direcly, it is possible to get a stream to a local file.

There are the OpenFileDialog and SaveFileDialog classes. These classes make it possible to let the user select a file or location. They return only a stream to that file and do not give any information about the filesystem. This way it's possible to import and export to excel for example.

This example should be enough to get you going.

update: in the meantime I did a small SilverBullet(tm) on the subject on my blog at http://www.timmykokke.com/