In my application, I am trying t create a WCF service that accepts a tabular json data and that converts that json data into Excel file stream and sends back to client. So for creating Excel file i am using the following code that uses Interop Service
object misValue = System.Reflection.Missing.Value;
var xlApp = new Excel.Application();
var xlWorkBook = xlApp.Workbooks.Add(misValue);
var xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets.Item[1];
xlWorkSheet.Cells[1, 1] = "FirstName";
xlWorkSheet.Cells[1, 2] = "Last Name";
xlWorkSheet.Cells[1, 3] = "Age";
xlWorkSheet.Cells[2, 1] = "Stezma";
xlWorkSheet.Cells[2, 2] = "Seb";
xlWorkSheet.Cells[2, 3] = "25";
xlWorkBook.SaveAs("csharp-Excel.xls", Excel.XlFileFormat.xlWorkbookNormal, misValue, misValue, misValue, misValue, Excel.XlSaveAsAccessMode.xlExclusive, misValue, misValue, misValue, misValue, misValue);
xlWorkBook.Close(true, misValue, misValue);
xlApp.Quit();
**Here my doubts are **
Is it advisable to use Interop Services for this requirement, If no What are the other alternatives that i can go for to create excel file stream.
If it is advisable how i can create the stream of that excel file created, Currently the files saves in document folder of machine. I don't want to save file into local folder, How i can get the stream of that file through interop method.