Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage")
XL.Initialize
Dim result As XLReaderResult = XL.Reader.ReadSheetByName(File.DirAssets, "Todo List.xlsx", "Sheet1") 'complete sheet
' result.LogResult(True)
B4XTable1.AddColumn(result.Get(XL.AddressName("B1")), B4XTable1.COLUMN_TYPE_TEXT) 'Task
B4XTable1.AddColumn(result.Get(XL.AddressName("C1")), B4XTable1.COLUMN_TYPE_NUMBERS) 'Status#
B4XTable1.AddColumn(result.Get(XL.AddressName("D1")), B4XTable1.COLUMN_TYPE_TEXT) 'Status
B4XTable1.AddColumn(result.Get(XL.AddressName("E1")), B4XTable1.COLUMN_TYPE_TEXT) 'Context
B4XTable1.AddColumn(result.Get(XL.AddressName("F1")), B4XTable1.COLUMN_TYPE_NUMBERS) 'Context#
B4XTable1.AddColumn(result.Get(XL.AddressName("H1")), B4XTable1.COLUMN_TYPE_NUMBERS) 'Category#
B4XTable1.AddColumn(result.Get(XL.AddressName("I1")), B4XTable1.COLUMN_TYPE_TEXT) 'Category
B4XTable1.AddColumn(result.Get(XL.AddressName("J1")), B4XTable1.COLUMN_TYPE_NUMBERS) 'Task Priority
B4XTable1.AddColumn(result.Get(XL.AddressName("K1")), B4XTable1.COLUMN_TYPE_NUMBERS) 'Aggregate Priority
B4XTable1.AddColumn(result.Get(XL.AddressName("M1")), B4XTable1.COLUMN_TYPE_TEXT) 'Project
B4XTable1.AddColumn(result.Get(XL.AddressName("P1")), B4XTable1.COLUMN_TYPE_TEXT) 'Due Date
B4XTable1.AddColumn(result.Get(XL.AddressName("Q1")), B4XTable1.COLUMN_TYPE_TEXT) 'Reminder Date
B4XTable1.AddColumn(result.Get(XL.AddressName("R1")), B4XTable1.COLUMN_TYPE_TEXT) 'Done Date
Dim TableData As List
TableData.Initialize
For Row1Based = 2 To result.BottomRight.Row0Based + 1
Dim Task As String = result.Get(XL.AddressOne("B", Row1Based))
Dim StatusNum As Int = result.Get(XL.AddressOne("C", Row1Based))
Dim Status As String = result.Get(XL.AddressOne("D", Row1Based))
Dim Context As String = result.Get(XL.AddressOne("E", Row1Based))
Dim ContextNum As Int = result.Get(XL.AddressOne("F", Row1Based))
Dim CategoryNum As Int = result.Get(XL.AddressOne("H", Row1Based))
Dim Category As String = result.Get(XL.AddressOne("I", Row1Based))
Dim TaskPriority As Int = result.Get(XL.AddressOne("J", Row1Based))
Dim AggregatePriority As Int = result.Get(XL.AddressOne("K", Row1Based))
Dim Project As String = result.Get(XL.AddressOne("M", Row1Based))
Dim DueDate As String = result.Get(XL.AddressOne("P", Row1Based))
If DueDate <> "" Then
DueDate = DateTime.Date(DueDate)
End If
Dim ReminderDate As String = result.Get(XL.AddressOne("Q", Row1Based))
If ReminderDate <> "" Then
ReminderDate = DateTime.Date(ReminderDate)
End If
Dim DoneDate As String = result.Get(XL.AddressOne("R", Row1Based))
If DoneDate <> "" Then
DoneDate = DateTime.Date(DoneDate)
End If
TableData.Add(Array(Task, StatusNum, Status, Context, ContextNum, CategoryNum, Category, TaskPriority, AggregatePriority, Project, DueDate, ReminderDate, DoneDate))
Next
B4XTable1.SetData(TableData)
End Sub