/// <summary>
        ///     复制行
        /// </summary>
        /// <param name="startRowIndex">开始行行标</param>
        /// <param name="endRowIndex">结束行行标</param>
        /// <returns>待追加的行标增量</returns>
        public void CopyRows(int startRowIndex, int endRowIndex)
        {
            startRowIndex = _rowIndexAccumulation.GetCurrentRowIndex(startRowIndex);
            endRowIndex   = _rowIndexAccumulation.GetCurrentRowIndex(endRowIndex);

            int span = _sheet.CopyRows(startRowIndex, endRowIndex);

            _rowIndexAccumulation.Add(span);
        }
Example #2
0
        public void CopyRepeaterTemplate(Repeater repeater, Action processTemplate)
        {
            var startRowIndex = _rowIndexAccumulation.GetCurrentRowIndex(repeater.Start.RowIndex);
            var endRowIndex   = _rowIndexAccumulation.GetCurrentRowIndex(repeater.End.RowIndex);

            int   span      = _sheet.CopyRows(startRowIndex, endRowIndex);
            ICell startCell = GetCell(repeater.Start);

            startCell.Value = startCell.GetStringValue().CutEndOf($"<[{repeater.Name}]");
            processTemplate();
            ICell endCell = GetCell(repeater.End);

            endCell.Value = endCell.GetStringValue().CutStartOf($">[{repeater.Name}]");
            _rowIndexAccumulation.Add(span);
        }
Example #3
0
 /// <summary>
 /// 复制行
 /// </summary>
 /// <param name="sheet">工作表</param>
 /// <param name="rowIndex">行索引</param>
 /// <returns></returns>
 public static int CopyRow(this ISheet sheet, int rowIndex)
 {
     return(sheet.CopyRows(rowIndex, rowIndex));
 }