Esempio n. 1
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());
        }
Esempio n. 2
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());
        }
Esempio n. 3
0
 /// <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);
     }
 }
Esempio n. 4
0
 /// <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);
     }
 }
Esempio n. 5
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);
     }
 }
Esempio n. 6
0
 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);
     }
 }