예제 #1
0
        //导出
        void UC_ExportEvent(object sender, EventArgs e)
        {
            if (this.dgvRecord.Rows.Count == 0)
            {
                return;
            }

            SaveFileDialog sfd = new SaveFileDialog();

            sfd.Filter = "Excel格式(*.xls)|*.xls";
            sfd.Title  = "导出报表";
            if (sfd.ShowDialog() == DialogResult.OK)
            {
                string fileName = sfd.FileName;
                CommonCtrl.OutPutExcel(this.dgvRecord, sfd.OpenFile(), fileName);
            }
        }