if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
string f;
f = saveFileDialog1.FileName.ToString();
System.IO.FileStream s = null;
s = new System.IO.FileStream(f, System.IO.FileMode.OpenOrCreate, System.IO.FileAccess.ReadWrite);
fpSpread1.Sheets[0].ColumnCount += 1;
fpSpread1.SaveExcel(s, FarPoint.Excel.ExcelSaveFlags.SaveCustomColumnHeaders);
fpSpread1.Sheets[0].ColumnCount -= 1;
s.Close();
App.AddLog(edsoft.Public.ParamSet.userName.ToString(), "员工档案导出");
MessageBox.Show("文件保存成功!", "提示");
}
通过以上代码,导出数据时,最后一条数据总是没有。 |
|