/*
         * This method will do the work of downloading the excel file with 'hopefully'
         * all the data.
         */
        private void EntireExcel()
        {
            DataExcel excel = new DataExcel();

            Response.ClearContent();
            Response.BinaryWrite(excel.GenerateExcel(GetData()));
            Response.AddHeader("content-disposition", "attachment; filename=ScienceCenterData.xlsx");
            Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
            Response.Flush();
            Response.End();
        }
Example #2
0
        /*
         * This method will do the work of downloading the excel file with 'hopefully'
         * all the data.
         */
        public void Excel(DateTime?start, DateTime?end)
        {
            DataExcel excel = new DataExcel();

            Response.ClearContent();
            Response.BinaryWrite(excel.GenerateExcel(GetData(start, end)));
            Response.AddHeader("content-disposition", "attachment; filename=MathCenterData.xlsx");
            Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
            Response.Flush();
            Response.End();
        }