views:

76

answers:

2

Is there a way to pass data from a View to a Controller so that I can get the data and create a .xls file on the fly?

Any help or thoughts are greatly appreciated.

Greg

+3  A: 

The easiest way is to create a CSV file, which can be opened directly by Excel.

Alternatively, you can use COM Interop to generate the Excel files.

The data is passed from the view to the controller method in the usual way. If you need help getting a collection of rows from the view, have a look here.

The data is provided to the user by returning a FileResult.

Robert Harvey