1金币
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);
|
最佳答案
查看完整内容
可以尝试使用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
|