/// <summary> Get all the views owned by a given sheet.</summary> public EtkView[] GetSheetViews(ExcelInterop.Worksheet sheet) { IEnumerable <IExcelTemplateView> views = ETKExcel.TemplateManager.GetSheetViews(sheet); if (views == null) { return(null); } return(views.Select(v => EtkView.CreateInstance(v)).ToArray()); }
/// <summary> Get all the views owned by a the current active sheet.</summary> public EtkView[] GetActiveSheetViews() { IEnumerable <IExcelTemplateView> views = ETKExcel.TemplateManager.GetActiveSheetViews(); if (views == null) { return(null); } return(views.Select(v => EtkView.CreateInstance(v)).ToArray()); }
public EtkView AddViewFromNames(string sheetTemplatePath, string templateName, string sheetDestinationName, string destinationRange, string clearingCell = null) { try { IExcelTemplateView view = ETKExcel.TemplateManager.AddView(sheetTemplatePath, templateName, sheetDestinationName, destinationRange, clearingCell); return(EtkView.CreateInstance(view)); } catch (Exception ex) { ETKExcel.ExcelApplication.DisplayException(null, "'Add View from names' failed", ex); return(null); } }