Multiple downloads

Jun 23, 2011 at 10:25 PM

I am trying to download several spreadsheets at the same time using  a loop.

the code I am using is the one I  found in the FAQ:

		// Create the workbook
            XLWorkbook workbook = new XLWorkbook();
            workbook.Worksheets.Add("Sample").Cell(1, 1).SetValue("Hello World");

            // Prepare the response
            HttpResponse httpResponse = Response;
            httpResponse.Clear();
            httpResponse.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
            httpResponse.AddHeader("content-disposition", "attachment;filename=\"HelloWorld.xlsx\"");

            // Flush the workbook to the Response.OutputStream
            using (MemoryStream memoryStream = new MemoryStream())
            {
                workbook.SaveAs(memoryStream);
                memoryStream.WriteTo(httpResponse.OutputStream);
                memoryStream.Close();
            }

            httpResponse.End();
after sending the first sheet it ends and return to the page closing the loop
(i have already tried comenting //httpResponse.End();)

Thank`s for your help.