如何自定义选择导入的EXCEL文件Sheet页?
FLEXGRID 导入EXCEL文件时,如保自动选择需要导入的SHEET页,现在好像只能导入第一页信息?OpenFileDialog dlg = new OpenFileDialog();
dlg.DefaultExt = "xls";
dlg.FileName = "*.xls";
if (dlg.ShowDialog() != DialogResult.OK)
return;
// clear data source, if any
jlflex.DataSource = null;
string[] sheets = jlflex.LoadExcelSheetNames(dlg.FileName);
Console.WriteLine("Found {0} sheets in this book.", sheets.Length);
FileFlags flags = FileFlags.LoadMergedRanges | FileFlags.IncludeFixedCells;
foreach (string sheet in sheets)
{
Console.WriteLine(" - {0}", sheet);
}
jlflex.LoadGrid(dlg.FileName, FileFormatEnum.Excel, flags);
本帖最后由 Richard.Ma 于 2022-10-31 17:21 编辑
可以尝试使用LoadExcel方法,可指定sheet
https://www.grapecity.com/componentone/docs/win/online-flexgrid/C1.Win.FlexGrid.ImportExport.6~C1.Win.FlexGrid.Extensions~LoadExcel(C1FlexGridBase,String,String).html 链接打不开
已经更新上面的链接
页:
[1]