Free Support Forum - aspose.com

Empty cells not in cells object

I am having a problem where the cells object doesn't include cells that are empty. I need them to be available for my loops to work correctly while passing data to the db.

wwWhen the initial spreadsheet is completely filled out everything works perfect but when a cell is left blank in the initial spreadsheet it also isn't included in the 'cells' object. I found that adding borders to the original spreadsheet fixed the problem but I really can't ask my end users to format their spreasdsheets.

Here is an example that I can't get to see the empty cells, how would I fix this? (ps, thanks for the help!!!)

Workbook wb = new Workbook();

wb.Open(fileio.FileContent);

Cells cells = wb.Worksheets[0].Cells;

int iTotal = cells.MaxDataColumn * cells.MaxDataRow + strHeaders.Length - 1;

            </p><p>string strCell, strHeader;</p><p>for (int iCnt = strHeaders.Length - 1; iCnt < iTotal; )
            </p><p>{
</p><p>    for (int iCol = 0; iCol < strHeaders.Length; iCol++)

{

strHeader = strHeaders[iCol];

strCell = cells[++iCnt].StringValue;

dat.AddParameter(strHeader, strCell); //this is where the blank cells are needed.

}

iRowCount++;

}

Hi,


Please test your issue with the latest version: Aspose.Cells for .NET v7.0.3.2 and let us know your feedback.

If you still find the issue, give us more details here. Also paste your complete runnable code here and attach your template file(s), we will check your issue soon.

Thank you.

That appears to take care of the problem, thanks.

Bill

Hi,

Thanks for your posting and using Aspose.Cells for .NET.

We are pleased to know that the given fix resolves your issue. We have also now added a new api to check if the cell object is null or it exists using the CheckCell() method, which you might use for your needs.

Besides, we have lately done some major enhancements and added new features in our product, so you should also download and give a try to latest offline demos of Aspose.Cells which you can find from theses links.

These demos can work with Visual Studio 2005, 2008 or 2010. Please read the readme.txt file before running the demos.