日期:2014-05-17 浏览次数:20977 次
private void simpleButton2_Click(object sender, EventArgs e)
{
if (gridView1.RowCount > 0)
{
saveFileDialog1.Title = "导出汇总数据到Excel";
//saveFileDialog1.FileName = "铁水汇总数据" + DateTime.Parse(dateEdit1.Text).ToString("yyyymmdd");
saveFileDialog1.Filter = "Excel文件(.xls)|*.xls";
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
gridControl1.ExportToXls(saveFileDialog1.FileName);
else
MessageBox.Show("导出汇总数据失败!");
}
else
{
MessageBox.Show("汇总报表无数据!");
}
}