Author: Dirkle | Posted on: 7/28/2010 1:20:28 PM | Views : 318

Hello,
I've been given a project to maintain and I'm wondering what's the best way to go about converting a List of objects from what the method Object.SerializeToString() returns (which is a string of XML representing the List of objects) and converting it to an Excel document. Currently, the code does this:
byte[] reportBytes = new byte[1024]; string results = collection.SerializeToString(); reportBytes = Encodng.Unicode.GetBytes(results); return File(reportBytes, "application/ms-excel", fileName);

Where fileName is something like "Report.XML".
The problem is that the customer is irritated that they have to right click the file that they download from the website and go to "Open With > Excel". And I've used NPOI on another similar project to export data, but can't really do that here since there are three report types with different types of data. So I ca ...

Go to the complete details ...