devExpress

GridControl导出到Excel

时间:2013-10-18 9:43:48  作者:WPF之家  来源:http://www.wpf123.com/  查看:2279  评论:0
内容摘要:SaveFileDialog fileDialog = new SaveFileDialog();fileDialog.Title = "导出Excel";fileDialog.Filter = "Excel文件(*.xls)|*.xls";DialogResult dia...
SaveFileDialog fileDialog = new SaveFileDialog();
fileDialog.Title = "导出Excel";
fileDialog.Filter = "Excel文件(*.xls)|*.xls";
DialogResult dialogResult = fileDialog.ShowDialog(this);
if (dialogResult == DialogResult.OK)
{
    DevExpress.XtraPrinting.XlsExportOptions options = new DevExpress.XtraPrinting.XlsExportOptions();
    gridControl1.ExportToXls(fileDialog.FileName);
    DevExpress.XtraEditors.XtraMessageBox.Show("保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}

标签:导出 GridControl 

原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。本文出自“wpf之家”,请务必保留此出处:http://www.wpf123.com

相关评论
Copyright © 2009-2014 WPF之家(http://www.wpf123.com/) All rights reserved
 Powered by WPF之家
鄂ICP备13006396号