Sub btnDate_Click
Dim Dd As DateDialog
'Dd.ShowCalendar = False
Dd.Year = DateTime.GetYear(DateTime.Now)
Dd.Month = DateTime.GetMonth(DateTime.Now)
Dd.DayOfMonth = DateTime.GetDayOfMonth(DateTime.Now)
ret = Dd.Show("Set the required date", "DITL Date Dialog", "Continue", "Cancel", "", Bmp)
Dim datestr As String
Dim monthstr As String
Dim daystr As String
monthstr = Dd.Month
daystr = Dd.DayOfMonth
If monthstr.Length < 2 Then monthstr = "0" & monthstr
If daystr.Length < 2 Then daystr = "0" & daystr
'datestr = daystr & "/" & monthstr & "/" & year
lblDate.Text = daystr & "/" & monthstr & "/" & Dd.Year
'
Dim workbook1 As ReadableWorkbook
Dim timesSheet As ReadableSheet
workbook1.Initialize(File.DirAssets, "locktimes.xls")
timesSheet = workbook1.GetSheet(0)
DateTime.DateFormat = "dd/MM/yyyy"
DateTime.TimeFormat = "hh:mm a"
Day1.Text = "Data Not Found"
lock1.Text = ""
highwater1.Text = ""
height1.Text = ""
lastlock1.Text = ""
lockclose1.Text = ""
lock2.Text = ""
highwater2.Text = ""
height2.Text = ""
lastlock2.Text = ""
lockclose2.Text = ""
If timesSheet.RowsCount > 0 Then
For row = 0 To timesSheet.RowsCount -1
Log($"Checking row: ${row}"$)
If timesSheet.GetCellValue(0, row) = lblDate.Text Then
'day 1st Lock HW Height Last Lock Lock Close
Day1.Text = timesSheet.GetCellValue(1, row)
lock1.Text = timesSheet.GetCellValue(2, row)
highwater1.Text = timesSheet.GetCellValue(3, row)
height1.Text = timesSheet.GetCellValue(4, row)
lastlock1.Text = timesSheet.GetCellValue(5, row)
lockclose1.Text = timesSheet.GetCellValue(6, row)
lock2.Text = timesSheet.GetCellValue(8, row)
highwater2.Text = timesSheet.GetCellValue(9, row)
height2.Text = timesSheet.GetCellValue(10, row)
lastlock2.Text = timesSheet.GetCellValue(11, row)
lockclose2.Text = timesSheet.GetCellValue(12, row)
End If
Next
End If
End Sub