B4X:
Public Sub ExportTableToCSV
private Provider As FileProvider
Private xui As XUI
Dim data As List
data.Initialize
Dim cursor As Cursor = Starter.Sql.ExecQuery("SELECT * from excelexport")
' cursor = Starter.sql.ExecQuery("SELECT * FROM agg where active=1")
' cursor
For i = 0 To cursor.RowCount - 1
cursor.Position = i
Dim row(cursor.ColumnCount) As String
For k = 0 To cursor.ColumnCount - 1
row(k) = cursor.GetString2(k)
Next
data.Add(row)
Next
cursor.Close
Provider.Initialize
Dim su As StringUtils
' xui.
Dim cf As String="excelldata.csv"
xui.SetDataFolder("feeto")
su.SaveCSV(xui.DefaultFolder, cf, ",", data) ''error java.lang.NullPointerException: Attempt to invoke interface method 'int java.lang.CharSequence.length()' on a null object reference
'tried this also
su.SaveCSV(File.DirInternal, cf , ",", data) '
'error java.lang.NullPointerException: Attempt to invoke interface method 'int java.lang.CharSequence.length()' on a null object reference
End Sub
Last edited: