/// <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()); }
/// <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> Remove a View.</summary> public void RemoveView(EtkView view) { try { ETKExcel.TemplateManager.RemoveView(view?.ExcelView); } catch (Exception ex) { ETKExcel.ExcelApplication.DisplayException(null, "'Remove View' failed", ex); } }
/// <summary> Rerender only the data of the View given as parameter public void RenderViewDataOnly(EtkView view) { try { ETKExcel.TemplateManager.RenderDataOnly(view?.ExcelView); } catch (Exception ex) { ETKExcel.ExcelApplication.DisplayException(null, "'Render View Data Only' failed", ex); } }
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); } }
public void SetDataSource(EtkView view, object dataSource) { try { if (view != null) { view.DataSource = dataSource; } } catch (Exception ex) { ETKExcel.ExcelApplication.DisplayException(null, "'Set Data Source' failed", ex); } }