Sub ShowAll
Main.sql1.Initialize(File.DirDefaultExternal,Main.FileDB,False)
Dim cursor1 As Cursor = Main.sql1.ExecQuery("Select * from data order by datetick")
Dim count As Int = cursor1.RowCount
DateTime.DateFormat = "dd/MM/yyyy"
Dim btnH As Int = PerXToCurrent(5)
Dim toppos As Int = PerYToCurrent(1)
Dim gap As Double = PerYToCurrent(0.25)
scrv1.Panel.Height = (count * btnH + (count * gap))
Dim TOut As Double = 0
Dim TIn As Double = 0
For i = 0 To count-1
cursor1.position = i
Dim DT As Long = cursor1.GetLong("Datetick")
Dim desc As String = cursor1.GetString("desc")
Dim AOut As Double = cursor1.GetDouble("Amountout")
Dim AIn As Double = cursor1.GetDouble("Amountin")
TOut = TOut + AOut
TIn = TIn + AIn
Dim b1 As Button
Dim b2 As Button
Dim b3 As Button
Dim b4 As Button
b1.Initialize("")
b2.Initialize("PressDesc")
b3.Initialize("")
b4.Initialize("")
b1.Color = Colors.Black
b1.TextColor = Colors.White
b1.TextSize = ts1
b2.TextSize = ts1
b3.TextSize = ts1
b4.TextSize = ts1
b1.Gravity = Gravity.LEFT
b2.Gravity = Gravity.LEFT
b3.Gravity = Gravity.right
b4.Gravity = Gravity.right
b1.Text = DateTime.Date(DT)
b2.Text = desc
b2.Tag = i
If AOut <> 0 Then
b3.Text = DP(AOut)
Else
b3.Text = ""
End If
If AIn <> 0 Then
b4.Text = DP(AIn)
Else
b4.Text = ""
End If
scrv1.Panel.AddView(b1,1%x,toppos,20%x,btnH)
scrv1.Panel.AddView(b2,21%x,toppos,40%x,btnH)
scrv1.Panel.AddView(b3,62%x,toppos,17%x,btnH)
scrv1.Panel.AddView(b4,79%x,toppos,17%x,btnH)
toppos = toppos + btnH + gap
Next
cursor1.Close
btnOut.Text = DP(TOut)
btnIN.Text = DP(TIn)
Cbal = Main.BankOpeningBalanceFromSystem + TOut + TIn
lblCBal.Text = DP(Cbal)
End Sub