コード例 #1
0
        private void ToExcel()
        {
            if (Session["DataTables"] == null)
            {
                this.RegisterStartupScript("无结果", "<script>alert('请先进行统计!');</script>");
                return;
            }

            Dictionary <string, DataTable> dataTables = Session["DataTables"] as Dictionary <string, DataTable>;

            if (dataTables == null)
            {
                this.RegisterStartupScript("无结果", "<script>alert('请先进行统计!');</script>");
                return;
            }

            try
            {
                DataToExcel dte = new DataToExcel();
                dte.DataGridViewToExcel(dataTables);
            }
            catch (Exception ex)
            {
                SeatManage.SeatManageComm.WriteLog.Write(ex.ToString());
            }
        }
コード例 #2
0
        private void ToExcel()
        {
            if (Session["DataTables"] == null)
            {
                this.RegisterStartupScript("无结果", "<script>alert('请先进行统计!');</script>");
                return;
            }

            Dictionary <string, DataTable> dataTables = Session["DataTables"] as Dictionary <string, DataTable>;

            if (dataTables == null)
            {
                this.RegisterStartupScript("无结果", "<script>alert('请先进行统计!');</script>");
                return;
            }
            DataToExcel dte = new DataToExcel();

            dte.DataGridViewToExcel(dataTables);
        }