EasyXLS
http://forum.easyxls.com/

Some additions
http://forum.easyxls.com/viewtopic.php?f=5&t=2183
Page 1 of 1

Author:  vassav [ Fri Feb 15, 2013 8:53 am ]
Post subject:  Some additions

Hi.

I use your library and found some bugs in it.
1. After adding the line, merging cells not recalculate, and stay in the same place.
For add a line, I use the this code:
Code:
public void InsertRow(int row,ExcelRow addedRow,ExcelTable table)
{
   table.easy_insertRow(row,addedRow);
   var mCount=table. MergeCellRangesCount
   var merginField=table.GetType().GetField("h",BindingFlags.NonPublic|BindingFlags.Instance);
   
   var mergin=(EasyXLS.Util.c)merginField.GetValue(table);
   for (int i = 0; i < mCount; i++)
   {
      int[] numArray = mergin.e(i);
       if(row>numArray[0]&&row<=numArray[2])
       {
            numArray[2]++;
       }
       else if(row<=numArray[0]&&row<=numArray[2])
       {
          numArray[0]++;
          numArray[2]++;
      }
   }

}


2. In some doсuments, after save in HTML have many empty columns in end.
For delete an empty columns, I use the this code:
Code:
        public void ValidateEmptyColums(ExcelTable table)
        {
            var maxCol = table.ColumnCount();
            var a = table.easy_getColumnAt(maxCol - 1);
            var col = maxCol - 1;
            var rows = table.RowCount();
            try
            {
                for (var j = col; j > 0; j--)
                {
                    var isNotEmpty = false;
                    for (var i = 0; i < rows; i++)
                    {
                        var cell = table.easy_getCellAt(i, j);
                        if (cell != null && !string.IsNullOrEmpty(cell.getValue()))
                        {
                            isNotEmpty = true;
                            break;
                        }
                    }
                    if (isNotEmpty)
                        break;
                    table.easy_removeColumn(j);
                }
            }
            catch (Exception e)
            {
                {

                }
            }
        }


Author:  oana [ Mon Feb 18, 2013 9:45 am ]
Post subject:  Re: Some additions

Hi!

1. EasyXLS deems ALL the positions as absolute, not only the merge related ones. If you insert lines, the positions won't change.

2. You must have formatted all the columns in the file. That's the reason why the .xlsx file contains all the available columns.

Thank you for helping us improve EasyXLS!

Page 1 of 1 All times are UTC - 4 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/