Case "Export"
Dim fc As FileChooser ' Use filechooser from jFX library
Dim fileSelected As String ' File selected. If selected full path is returned else ""
Dim n,p As String
Dim response As Int
fc.Initialize
fc.InitialDirectory = GetSystemProperty("user.home", "c:\") ' Set starting folder
fc.Title = "Select a File to receive the data..."
fc.SetExtensionFilter("Excel files..",Array As String("*.xls","*.xlsx"))
response=fx.Msgbox2(Null,"Please select a BLANK Excel file ...","Export","OK", "Cancel", "", fx.MSGBOX_INFORMATION)
If response=-3 Then
Toast.ToastShow("Export was cancelled.")
Return
End If
fileSelected = fc.ShowOpen(MediaForm) ' Show the dialog and select
If fileSelected="" Then Exit
'Return fileSelected
Dim fileO As JavaObject
fileO.InitializeNewInstance("java.io.File", Array As Object(fileSelected))
n = fileO.RunMethod("getName",Null)
p = fileO.RunMethod("getPath", Null)
p = p.Replace(n, "")
Hdrlist.Initialize
Poi.InitializeExisting(p,n,"")