Exemplo n.º 1
0
        private void WriteRowValues(object[] values, int rowNum, int startCol)
        {
            if (mSheet == null)
            {
                return;
            }

            var row = mSheet.GetRow(rowNum);

            if (row == null)
            {
                row = mSheet.CreateRow(rowNum);
            }
            for (int i = 0; i <= startCol + values.Length; i++)
            {
                var cell = row.GetCell(i);
                if (cell == null)
                {
                    row.CreateCell(i);
                }
            }

            CellRangeAddress range = new CellRangeAddress(rowNum, rowNum, startCol, startCol + values.Length - 1);

            CellWalk cw = new CellWalk(mSheet, range);

            cw.SetTraverseEmptyCells(true);

            CellInserter ci = new CellInserter(new List <object>(values));

            cw.Traverse(ci);
        }
Exemplo n.º 2
0
        private void WriteRowValues(object[] values, int rowNum, int startCol)
        {
            if (mSheet == null)
            {
                return;
            }

            CellRangeAddress range = new CellRangeAddress(rowNum, rowNum, startCol, startCol + values.Length - 1);

            CellWalk cw = new CellWalk(mSheet, range);

            cw.SetTraverseEmptyCells(true);

            CellInserter ci = new CellInserter(new List <object>(values));

            cw.Traverse(ci);
        }
Exemplo n.º 3
0
        private void AddHeaderColumns(int startCol, int rowNum)
        {
            if (ColumnsHeaders.Count != 0)
            {
                if (mSheet == null)
                {
                    return;
                }

                var row = mSheet.GetRow(rowNum);
                if (row == null)
                {
                    row = mSheet.CreateRow(rowNum);
                }
                for (int i = 0; i <= startCol + ColumnsHeaders.ToArray().Length; i++)
                {
                    var cell = row.GetCell(i);
                    if (cell == null)
                    {
                        row.CreateCell(i);
                    }
                }

                CellRangeAddress range = new CellRangeAddress(StartRow == 0
                        ? 0
                        : StartRow, StartRow == 0
                        ? 0
                        : StartRow, startCol, startCol + ColumnsHeaders.ToArray().Length - 1);

                CellWalk cw = new CellWalk(mSheet, range);
                cw.SetTraverseEmptyCells(true);

                CellInserter ci = new CellInserter(new List <object>(ColumnsHeaders));

                cw.Traverse(ci);
            }
        }
Exemplo n.º 4
0
        private void WriteRowValues( object[] values, int rowNum, int startCol )
        {
            if( mSheet == null )
                return;

            CellRangeAddress range = new CellRangeAddress( rowNum, rowNum, startCol, startCol + values.Length - 1 );

            CellWalk cw = new CellWalk( mSheet, range );
            cw.SetTraverseEmptyCells( true );

            CellInserter ci = new CellInserter( new List<object>( values ) );
            cw.Traverse( ci );
        }
Exemplo n.º 5
0
     private void AddHeaderColumns(int startCol,int rowNum)
     {       
          if (ColumnsHeaders.Count != 0)
         {
             if (mSheet == null)
                 return;
             
             var row = mSheet.GetRow(rowNum);
             if (row == null)
                 row = mSheet.CreateRow(rowNum);
             for (int i = 0; i <= startCol + ColumnsHeaders.ToArray().Length; i++)
             {
                 var cell = row.GetCell(i);
                 if (cell == null)
                     row.CreateCell(i);
             }
 
             CellRangeAddress range = new CellRangeAddress(StartRow == 0
                     ? 0
                     : StartRow, StartRow == 0
                     ? 0
                     : StartRow, startCol, startCol + ColumnsHeaders.ToArray().Length - 1);
 
             CellWalk cw = new CellWalk(mSheet, range);
             cw.SetTraverseEmptyCells(true);
 
             CellInserter ci = new CellInserter(new List<object>(ColumnsHeaders));
 
             cw.Traverse(ci);            
         }
     }
Exemplo n.º 6
0
        private void WriteRowValues(object[] values, int rowNum, int startCol)
        {
            if (mSheet == null)
                return;

            if (ColumnsHeaders.Count != 0)
            {
                rowNum++;
            }
            
            var row = mSheet.GetRow(rowNum);
            if (row == null)
                row = mSheet.CreateRow(rowNum);
            for (int i = 0; i <= startCol + values.Length; i++) {
                var cell = row.GetCell(i);
                if (cell == null)
                    row.CreateCell(i);
            }

            CellRangeAddress range = new CellRangeAddress(rowNum, rowNum, startCol, startCol + values.Length - 1);

            CellWalk cw = new CellWalk(mSheet, range);
            cw.SetTraverseEmptyCells(true);

            CellInserter ci = new CellInserter(new List<object>(values));

            cw.Traverse(ci);
        }