我有DevExpress.XtraGrid.Views.Grid.GridView gridView;
我可以使用
gridView.ExportToXls(fileDialog.FileName);
但我不仅需要保存数据,还要添加页脚。
例如:
any text string, date and other text
column1 column2 column3 ...
data data data ...
data data data ...
... ... ... ...
代码:
public void Export(GridView gridView)
{
try
{
SaveFileDialog fileDialog = GetFileDialog();
if (fileDialog.ShowDialog() == DialogResult.OK)
{
gridView.ExportToXls(fileDialog.FileName);
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}