Esempio n. 1
0
        /// <summary>設定文件表尾</summary>
        private void SetDocumentFooter(RowTemplateConfig config)
        {
            int _num;
            int _sheetIndex;

            HSSFSheet _sourceSheet;

            _num         = config.RowIndexStart;
            _sheetIndex  = config.SheetIndex;
            _sourceSheet = this._workBook.GetSheetAt(_sheetIndex) as HSSFSheet;

            while (_num <= config.RowIndexEnd)
            {
                this.CopyRow(_sourceSheet, _num);
                _num = _num + 1;
                this.SetFormula();
            }
        }
Esempio n. 2
0
        /// <summary>設定資料列內容</summary>
        /// <param name="config">資料列範本設定物件</param>
        /// <param name="action">執行方法委派</param>
        private void SetRow(RowTemplateConfig config, Action action)
        {
            int _num;
            int _sheetIndex;

            HSSFSheet _sourceSheet;

            _num         = config.RowIndexStart;
            _sheetIndex  = config.SheetIndex;
            _sourceSheet = this._workBook.GetSheetAt(_sheetIndex) as HSSFSheet;

            while (_num <= config.RowIndexEnd)
            {
                this.CopyRow(_sourceSheet, _num);
                action();
                _num = _num + 1;
            }
        }