Reply to topic  [ 2 posts ] 
Some additions 
Author Message

Joined: Fri Feb 15, 2013 7:40 am
Posts: 1
Reply with quote
Post 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)
            {
                {

                }
            }
        }



Fri Feb 15, 2013 8:53 am
Profile

Joined: Wed Nov 07, 2007 4:42 am
Posts: 67
Reply with quote
Post 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!


Mon Feb 18, 2013 9:45 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.