将数据导出到excel [英] Export data from dataset to excel
本文介绍了将数据导出到excel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
解决方案我试图将数据从数据集导出到excel并将其直接保存到给定的路径,而不给我打开,保存或取消的选项。方案
此 C#Excel库也可用于导出数据集。有关如何导出的更多详细信息,请参见 here 。
ExcelDocument xls = new ExcelDocument();
xls.easy_WriteXLSFile_FromDataSet(ExcelFile.xls,数据集,
新的ExcelAutoFormat(Styles.AUTOFORMAT_EASYXLS1),工作表名称);
I am trying to export data from dataset to excel and save it directly to a given path without giving me the option to open,save or cancel.
解决方案
This C# Excel library can also be used to export the dataset. More details about how to export can be found here.
ExcelDocument xls = new ExcelDocument();
xls.easy_WriteXLSFile_FromDataSet("ExcelFile.xls", dataset,
new ExcelAutoFormat(Styles.AUTOFORMAT_EASYXLS1), "Sheet Name");
这篇关于将数据导出到excel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文