Ejemplo n.º 1
0
        /// <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());
        }
Ejemplo n.º 2
0
        /// <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());
        }
Ejemplo n.º 3
0
 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);
     }
 }