Please help me out
the error comes at
the error comes at
B4X:
B4XTable1.Clear
B4X:
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim cursor1 As Cursor
Type StateType (TextUp As String, TextDown As String, _
IndexUp As Int, IndexDown As Int)
Dim State As StateType 'This must be a process variable as it stores the state
'and should not be released when the activity is destroyed.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim txtUp, txtDown As EditText
Private B4XTable1 As B4XTable
'Private xui As XUI
Dim data As List
Dim StudentName As EditText
Dim Account As EditText
Dim Classr As EditText
Dim Latestdata As RadioButton
'Dim kname As String
Dim spnFirstName As Spinner
Dim Spinner1 As Spinner
Dim ImageView1 As B4XView
Private xui As XUI
End Sub
Sub ResetState
'set the starting state
State.TextUp = 1
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("academicextract")
Activity.Title="Extract Results"
txtUp.Initialize("txtUp")
txtDown.Initialize("txtDown")
Log(ResetState)
'ProgressDialogShow2("Fetching data...", False)
ShowTable
'years
'getterm
End Sub
Sub IsConnectedToInternet As Boolean
Dim r As Reflector
r.Target = r.GetContext
r.Target = r.RunMethod2("getSystemService", "connectivity", "java.lang.String")
r.Target = r.RunMethod("getActiveNetworkInfo")
If r.Target <> Null Then
Return r.RunMethod("isConnectedOrConnecting")
End If
Return False
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
Activity.Finish
End Sub
Sub ShowTable
B4XTable1.Clear
B4XTable1.AddColumn("Student Names", B4XTable1.COLUMN_TYPE_TEXT).Width=150dip
B4XTable1.AddColumn("Class", B4XTable1.COLUMN_TYPE_TEXT).Width=70dip
B4XTable1.AddColumn("Amount", B4XTable1.COLUMN_TYPE_TEXT)
B4XTable1.AddColumn("Account", B4XTable1.COLUMN_TYPE_TEXT)
Dim data As List
data.Initialize
' Dim rs As ResultSet = Starter.sql1.ExecQuery("SELECT DISTINCT Names,Class || Stream As CS,Account,Amount As Balance FROM Balances ORDER BY Names ASC;" )
cursor1 = Starter.SQL1.ExecQuery("SELECT phone AS Phone,Sex FROM Register")
If cursor1.RowCount > 0 Then
cursor1.Position =0
Dim Phonet As String
Phonet = cursor1.Getstring("Phone")
End If
Dim rs As ResultSet = Starter.SQL1.ExecQuery2("SELECT DISTINCT Names,Class || Stream As CS,Account,Amount As Balance FROM Balances WHERE Phone = ?", Array As String(Phonet))
Do While rs.NextRow
Dim row(4) As Object
row(0) = rs.GetString("Names")
row(1) = rs.GetString("CS")
row(2) = rs.GetString("Balance")
row(3) = rs.GetString("Account")
data.Add(row)
Loop
rs.Close
B4XTable1.SetData(data)
'B4XTable1.VisibleColumns.RemoveAt(B4XTable1.VisibleColumns.IndexOf("Account"))
End Sub
B4X:
Category: Active
Froms: /Date(1578258000000)/
Tos: /Date(1581714000000)/
06/01/2020
06/01/2020
15/02/2020
15/02/2020
result: Good
** Activity (main) Pause, UserClosed = false **
** Activity (curveextracted) Create, isFirst = true **
Error occurred on line: 505 (B4XTable)
java.lang.RuntimeException: Object should first be initialized (B4XView).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:50)
at anywheresoftware.b4a.objects.B4XViewWrapper.asViewWrapper(B4XViewWrapper.java:70)
at anywheresoftware.b4a.objects.B4XViewWrapper.getTag(B4XViewWrapper.java:557)
at com.kccug.kabojjajuniorapp.b4xtable._setpagelabelstate(b4xtable.java:2092)
at com.kccug.kabojjajuniorapp.b4xtable._clearnavigationstate(b4xtable.java:2041)
at com.kccug.kabojjajuniorapp.b4xtable$ResumableSub_Clear.resume(b4xtable.java:644)
at com.kccug.kabojjajuniorapp.b4xtable._clear(b4xtable.java:507)
at com.kccug.kabojjajuniorapp.curveextracted._showtable(curveextracted.java:437)
at com.kccug.kabojjajuniorapp.curveextracted._activity_create(curveextracted.java:408)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)