Exemple #1
0
        public Subtotal(IXLRange range, bool summaryAbove)
        {
            _range        = range;
            _summaryAbove = summaryAbove;
            Sheet.Outline.SummaryVLocation = _summaryAbove ? XLOutlineSummaryVLocation.Top : XLOutlineSummaryVLocation.Bottom;
            var          workbook  = Sheet.Workbook;
            const string tempsheet = "__tempsheet";

            if (!workbook.Worksheets.TryGetWorksheet(tempsheet, out _tempSheet))
            {
                _tempSheet = workbook.AddWorksheet(tempsheet);
                _tempSheet.Hide();
            }
        }
        public Subtotal(IXLRange range, bool summaryAbove, GroupTag[] groupTags = null, FormulaEvaluator evaluator = null)
        {
            _range        = range;
            _summaryAbove = summaryAbove;
            _groupTags    = groupTags;
            _evaluator    = evaluator;
            Sheet.Outline.SummaryVLocation = _summaryAbove ? XLOutlineSummaryVLocation.Top : XLOutlineSummaryVLocation.Bottom;
            var          workbook  = Sheet.Workbook;
            const string tempsheet = "__tempsheet";

            if (!workbook.Worksheets.TryGetWorksheet(tempsheet, out _tempSheet))
            {
                _tempSheet       = workbook.AddWorksheet(tempsheet);
                _tempSheet.Style = Sheet.Style;
                _tempSheet.Hide();
            }
        }