Hi all,
i'm creating a csv file and allowing the user to save it where he wants in the device. Code:
Now, if I transfer the generated file on a Windows PC and open it with Excel, it looks correct, with the header and separate columns.
But if I open it directly on the device with Excel Mobile, the file is opened as csv text and not formatted in columns
Where is the problem ?
On B4i side instead, the file is generated with the same identical code and then saved with this other code and then it is correctly opened on the device with Excel Mobile.
i'm creating a csv file and allowing the user to save it where he wants in the device. Code:
B4X:
Dim csvlist as list
Dim FileHandler1 As FileHandler
csvlist.initialize
Dim rw(3)As String
rw(0)="value1"
rw(1)="value2"
rw(2)="value3"
csvlist.Add(rw)
rw(0)="value1"
rw(1)="value2"
rw(2)="value3"
csvlist.Add(rw)
Dim CSVHeaders As List
CSVHeaders.Initialize2(Array As String("Field1","Field2","Field3")
Dim su As StringUtils
su.SaveCSV2(File.DirInternal,"mycsv.csv",",",csvlist,CSVHeaders)
FileHandler1.Initialize
Wait For (FileHandler1.SaveAs(File.OpenInput(File.DirInternal,"mycsv.csv"), "text/csv", "mycsv.csv")) Complete (Success As Boolean)
Now, if I transfer the generated file on a Windows PC and open it with Excel, it looks correct, with the header and separate columns.
But if I open it directly on the device with Excel Mobile, the file is opened as csv text and not formatted in columns
B4X:
Field1,Field2,Field3
Value1,Value2,Value3
Value1,Value2,Value3
Where is the problem ?
On B4i side instead, the file is generated with the same identical code and then saved with this other code and then it is correctly opened on the device with Excel Mobile.
B4X:
Dim avc As ActivityViewController
avc.Initialize("avc", Array(MySub.CreateFileUrl(File.DirTemp,"mycsv.csv")))
avc.Show(Page1, Page1.RootPanel)
Wait For avc_Complete (Success As Boolean, ActivityType As String)