B4J Question Detect empty Poi cells

oldeast

Active Member
Licensed User
Longtime User
Is this the correct way to do it?
B4X:
'get the number of rows
x=sheet.LastRowNumber
Dim pc As PoiCell
XLList.initialize
'get only data rows, avoid header row
For i=1 To x
     For j = 0 To 7 'eight columns
        If sheet.GetRow(i).GetCell(j).IsInitialized=True Then
         pc=(sheet.GetRow(i).GetCell(j))
            'convert all data to string
            pc.CellType=1
            XLList.add(pc)
         Else
             XLList.Add("")
            End If
    Next
Next
Thanks
 

Daestrum

Expert
Licensed User
Longtime User
That's how I check for blank cells.

Just a thought, you add the actual cell to the list or the "" String maybe you want XLList.add(pc.value) if you just want the values in the list.
 
Upvote 0

oldeast

Active Member
Licensed User
Longtime User
Thanks for your reply.
I want to be sure I import all the cells even in if they are null from the Excel spreadsheet.
This data will be added to a SQLLite table so an empty cell is still "data".
Thanks
Graham
 
Upvote 0
Top