Issue while accessing worksheet cells

Last post 04-26-2007, 8:06 PM by Warren. 5 replies.
Sort Posts: Previous Next
  •  04-25-2007, 9:41 AM 74367

    Issue while accessing worksheet cells

    Hi Aspose Team,

    I am trying to access each for a worksheet but found that refernce to some column cells is not accessible( eg Column 7). I have attached the xls sheet used to test 7 below is the code snipppet.

    Workbook workbook = new Workbook();

    workbook.open("C:\\temp\\MOORE\\TEST_TEMPLATE.xls",FileFormatType.DEFAULT);

    Worksheet templateSheet = workbook.getWorksheets().getSheet(1);

    Cells cells = templateSheet.getCells();

    Row sourceRow;

    Cell sourceCell;

    int endRow = 5;//templateSheet.getCells().getMaxDataRow();

    System.out.println("Max Rows "+endRow);

    for(Iterator it = cells.getRowIterator(); it.hasNext(); )

    {

    sourceRow = (Row)it.next();

    if(sourceRow.getRowIndex() > endRow){

    break;

    }

    for(Iterator cellIt = sourceRow.getCellIterator(); cellIt.hasNext();)

    {

    sourceCell = (Cell)cellIt.next();

    System.out.println("Column Index "+sourceCell.getColumnIndex());

    }

    }

    Please note I was not able to upload the file for testing due some error. Can you give me an alternative location where I can post the file?

     

    Thanks,

    rohitob

     
  •  04-25-2007, 8:15 PM 74448 in reply to 74367

    Re: Issue while accessing worksheet cells

    Hi rohitob,

    RowIterator  is used to visit all rows (which are inited).

    CellIterator is used to visit all cells (which are inited) in the row.

    If the row or cell is not inited , the iterator will not visit it.So  I think that the cell in the column 7 is inited.

    If the cell in the column 7 is inited and CellIterator do not return the cell, you can zip your template file ,then attach the zip.We will try to fix it.


    Warren Zhang
    Developer
    Aspose Nanjing Team
    About Us
    Contact Us
     
  •  04-25-2007, 10:13 PM 74457 in reply to 74448

    Re: Issue while accessing worksheet cells

    Attachment: Present (inaccessible)

    Hi Warren,

    Please find attached the template file having access issue while iterating over rows/cells.

    Apart from the issues I have reported so far ( thxs to Aspose Team were resolved as well) , I have a couple of xls files which are currently not parsed by Aspose cell as received from clients directly. But when I try to open the xls file in Excel client, save & then try to parse with Aspose cell it works fine.Due to sensitivity of client data I cannot publish the file on these forums.

    Is there any debug/log option availble when I run the Aspose cells which I can genereate & send you to investigate instead of sending these sensitive files?

    Thanks,

    rohitob

     

     
  •  04-26-2007, 1:51 AM 74465 in reply to 74457

    Re: Issue while accessing worksheet cells

    Attachment: Present (inaccessible)

    Hi rohitob,

    In your template file , I can get the cell in column 7.Something notes again, CellIterator only returns the cell which is defined.

    I add Cells.checkRow() to check the row is defined. If the method returns null, you can not access this row in the RowIterator.

    I add Cells.checkCell() to check the cell is defined.If the method returns null, you can not access this cell in the CellIterator.

    Please try this fix.


    Warren Zhang
    Developer
    Aspose Nanjing Team
    About Us
    Contact Us
     
  •  04-26-2007, 10:13 AM 74546 in reply to 74465

    Re: Issue while accessing worksheet cells

    Thxs will try..

    Any response to my query on debug/log option mentioned above?

     
  •  04-26-2007, 8:06 PM 74597 in reply to 74546

    Re: Issue while accessing worksheet cells

    Hi,

    The attached file is only visible for Aspose Member. And you can create private post which is only visible for you and Aspose Member.

    Now we do not support the debug/log option. If you find any error, we will fix it quickly with your info.


    Warren Zhang
    Developer
    Aspose Nanjing Team
    About Us
    Contact Us
     
View as RSS news feed in XML