spread Excel 出力
if(message.ShowMessage("ConfirmExportToExcel") == DialogResult.No)
{
return;
}
//保存ファイル位置を選択
string saveFileName="";
SaveFileDialog saveDialog=new SaveFileDialog();
saveDialog.DefaultExt ="xls";
saveDialog.Filter="Excelファイル|*.xls";
saveDialog.FileName =this.ApplicationName;
saveDialog.RestoreDirectory = true;
saveFileName=saveDialog.FileName;
if(saveDialog.ShowDialog() == DialogResult.Cancel)
{
return;
}
saveFileName=saveDialog.FileName;
this.ShowProgress();
this.spdtemp.ActiveSheet.DataSource = ds.Tables[0].DefaultView;//spread数据源设定。
出力操作を行う
try
{
this.spdtemp.SaveExcel(saveFileName,FarPoint.Win.Spread.Model.IncludeHeaders.ColumnHeadersCustomOnly);
}
catch
{
this.CloseProgress();
return;
}
this.CloseProgress();
本文介绍了一种使用Spread组件将数据导出到Excel文件的方法。包括确认导出、选择保存位置、设置数据源及最终的文件保存过程。通过具体代码示例展示了如何实现这一功能。
709

被折叠的 条评论
为什么被折叠?



