Esempio n. 1
0
        /// <summary>
        /// 导出Excel
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        protected void btnExportExcel_Click(object sender, EventArgs e)
        {
            int       count    = 0;
            var       DataList = _logService.GetPagedList <DateTime?>(CtrPageIndex.CurrentPageIndex, CtrPageIndex.PageSize, ref count, null, c => c.LoginDate, false);
            DataTable dt       = ListToDataTable.ListToTable <sys_LoginLog>(DataList);

            ExcelUtil.RenderToExcel(dt, Context, "日志.xls");
        }