1

How can I create an MS Excel sheet and download it from a Moonlight/Silverlight app? Regards Lennie

Basically I want to run a report in the Siverlight client and allow the user to download the MS Excel report.

  • A little more detail would be helpfull here... Are you trying to create the excel sheet from a server, or a computer that has excell installed? For the download, I would suggest you use a wcf service that reads the excel file as a byte array, and send that through to the silverlight client requesting it. – Nathan Dec 21 '10 at 09:10
  • More info: "Basically I want to run a report in the Siverlight client and allow the user to download the MS Excel report." – Lennie De Villiers Dec 21 '10 at 09:27
  • I assume that the actual report will come from a webservice, so I think the easiest solution would be to pass the url where the report can be downloaded to your html page javascript, and open it from there with window.open() – Nathan Dec 21 '10 at 09:42

2 Answers2

0

use npoi to generate the excel in server temporarily , until it is downloaded by the user , then delete it .

Thunder
  • 10,366
  • 25
  • 84
  • 114
0

I had to do this previously, its pretty time consuming but you can write it to a XML file on the client side.

A good place to start is to create a new excel sheet save it as an XML file and then you can work out which bits need to change and then work out a way to write the correct information to the XML file.

Although as I said it will take a fair bit of time!!

Edit-

Just found this for you to take a look at- http://www.rshelby.com/post/creating-excel-worksheet-from-silverlight.aspx

Jason Quinn
  • 2,443
  • 3
  • 28
  • 36