title: Create excel file and download it without saving it into the server, is it possible?
body: <p>i have managed to create an excel file with interop, and now i want that excel file to be downloaded
  in web browser instead of saving in in drive.</p>
  
  <pre><code>     var xlApp = new Excel.Application();
       Excel.Workbook xlWorkBook = xlApp.Workbooks.Add();
       Excel.Worksheet xlWorkSheet = xlWorkBook.Sheets[1];
       Excel.Range chartRange;
  
        var attendance_list = CTX.schedules.Where(s =&gt; s.event_id == Convert.ToInt32(param));
        if (attendance_list.Count() &gt; 0)
        {
               xlWorkSheet.Cells[1, 1] = "PIC : ";
               xlWorkSheet.Cells[2, 1] = "Tempat : ";
  
               xlWorkSheet.Cells[1, 2] = attendance_list.FirstOrDefault().calendar_event.PIC;
               xlWorkSheet.Cells[2, 2] = attendance_list.FirstOrDefault().calendar_event.sched_loc;
  
               xlWorkSheet.Shapes.AddPicture(@Server.MapPath("~/Images/" + "oto_group2.png"), MsoTriState.msoFalse, MsoTriState.msoCTrue, 50, 50, 100, 45);
  
               xlWorkSheet.Shapes.AddPicture(@Server.MapPath("~/Images/" + "oto_group3.png"), MsoTriState.msoFalse, MsoTriState.msoCTrue, 280, 50, 100, 45);
  
               int row = 10;
               int idx = 0;
  
               xlWorkSheet.Cells[9, 1] = "No";
               xlWorkSheet.Cells[9, 2] = "Name";
               xlWorkSheet.Cells[9, 3] = "Phone";
               xlWorkSheet.Cells[9, 4] = "Time";
               xlWorkSheet.Cells[9, 5] = "Branch";
               xlWorkSheet.Cells[9, 6] = "Sign";
               xlWorkSheet.Cells[9, 7] = "Note";
  
               chartRange = (xlWorkSheet.get_Range("b9"));
               chartRange.ColumnWidth = 40;
  
               chartRange = (xlWorkSheet.get_Range("c9"));
               chartRange.ColumnWidth = 20;
  
               chartRange = (xlWorkSheet.get_Range("g9"));
               chartRange.ColumnWidth = 20;
  
               var key = CTX.translate_value_ms.Where(t =&gt; t.PSF_type == "HRS_PHONE_TYPE"
                                                                       &amp;&amp; t.value == "CELL").FirstOrDefault().translate_value_id;
  
               foreach (var item in attendance_list)
                {
                   idx++;
  
                    var hp = item.user_list.user_phones.Where(p =&gt; p.phone_type_id == key).FirstOrDefault();
  
                    xlWorkSheet.Cells[row, 1] = idx;
                    xlWorkSheet.Cells[row, 2] = displayFullName(item.user_list.fname, item.user_list.mname, item.user_list.lname);
                    xlWorkSheet.Cells[row, 3] = hp.phone_number;
                    xlWorkSheet.Cells[row, 4] = item.calendar_event.time_range;
                    xlWorkSheet.Cells[row, 5] = item.calendar_event.branch;
                    xlWorkSheet.Cells[row, 6] = "";
                    xlWorkSheet.Cells[row, 7] = "";
  
                       row++;
               }
  
               chartRange = xlWorkSheet.get_Range("a9", "g9");
               chartRange.Font.Bold = true;
               chartRange.Interior.Color = System.Drawing.Color.Gray;
  
               chartRange = xlWorkSheet.get_Range("a9",  "g" + (row - 1));
               chartRange.BorderAround(Excel.XlLineStyle.xlContinuous, Excel.XlBorderWeight.xlMedium, Excel.XlColorIndex.xlColorIndexAutomatic, Excel.XlColorIndex.xlColorIndexAutomatic);
  
               xlWorkBook.SaveAs("csharp.net-informations.xls", Excel.XlFileFormat.xlWorkbookNormal);
  
               xlWorkBook.Close(true);
               xlApp.Quit();
  
               Marshal.ReleaseComObject(xlApp);
       }
  </code></pre>
  
  <p>this is what i have tried so far to create excel file. need some englightment. "this code save excel file to drive, which is not the result that i want to achieve."</p>
  
  <p>this is my generated excel : <img src="https://i.stack.imgur.com/rXW0I.png" alt="enter image description here"></p>