Beispiel #1
0
        public ActionResult Export(SysParamsListViewModel m)
        {
            //分頁物件,設定單頁筆數為最大值
            Pages pages = new Pages();

            pages.PageSize = int.MaxValue;

            //清單資料
            DataTable dtList = SysParamsDataAccess.GetSysParams(m.Parameters.ParaCode, m.Parameters.ParaDesc, m.Pages);

            //轉為二進位資料流
            var          numList = new List <int>();
            MemoryStream ms      = NPOITools.RenderDataTableToExcel(dtList, numList) as MemoryStream;

            return(File(ms.ToArray(), "application/vnd.ms-excel"));
        }
        public ActionResult Export(GroupListViewModel m)
        {
            //分頁物件,設定單頁筆數為最大值
            Pages pages = new Pages();

            pages.PageSize = int.MaxValue;

            //取回資料
            var dt = GroupDataAccess.GetGroupList(null, m.Parameters.GroupName, pages);

            //轉為二進位資料流
            var          numList = new List <int>();
            MemoryStream ms      = NPOITools.RenderDataTableToExcel(dt, numList) as MemoryStream;

            return(File(ms.ToArray(), "application/vnd.ms-excel"));
        }
Beispiel #3
0
        public ActionResult Export(UserListViewModel m)
        {
            //分頁物件,設定單頁筆數為最大值
            Pages pages = new Pages();

            pages.PageSize = int.MaxValue;

            //取回資料
            DataTable dt = UserDataAccess.GetUserList(null, m.Parameters.Account, null, m.Parameters.Email, m.Parameters.Name, pages);

            //處理資料
            dt.Columns.Remove("Password");

            //轉為二進位資料流
            var          numList = new List <int>();
            MemoryStream ms      = NPOITools.RenderDataTableToExcel(dt, numList) as MemoryStream;

            return(File(ms.ToArray(), "application/vnd.ms-excel"));
        }