B4J Question Read data from Excel

besoft

Active Member
Licensed User
Longtime User
Hi

I would like to read from excel file in a specific sheet data from a known cell range. These data will be written in oracle database. Writing in the Oracle database and read from the database works. Does anyone have any example of how to implement it. I watched jPOI library, but I do not know how to begin reading data from the excel table.
 

DonManfred

Expert
Licensed User
Longtime User
Last edited:
Upvote 0

besoft

Active Member
Licensed User
Longtime User
Thanks for the reply
I apologize for the late reply, I had another job. Currently I do not have any code to work excel files. I was planning to use jPOI library because the file type * .xlsx.
I have to study for example in the forum. I would like to read the names of the worksheets from the files. These names are the key data to be stored in the database. Then the contents of the worksheet in a given area.
Can anyone make an example using jPOI library, of course, for a fee.
I have very little time for research because a lot of other work in the workplace.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Can anyone make an example using jPOI library, of course, for a fee.

B4X:
Sub Process_Globals
    Private fx As JFX
    Private MainForm As Form
    Private poi As PoiWorkbook
End Sub

Sub AppStart (Form1 As Form, Args() As String)
    MainForm = Form1
    MainForm.SetFormStyle("UNIFIED")
    'MainForm.RootPane.LoadLayout("Layout1") 'Load the layout file.
    'poi.InitializeExisting(File.DirAssets,"Mappe1.xls","")
    poi.InitializeExistingAsync("Excel",File.DirAssets,"Mappe1.xls","")
    MainForm.Show
End Sub
Sub Excel_Ready (Success As Boolean)
    If Success Then
        Log("No of Sheets: "&poi.NumberOfSheets)
        For i = 0 To poi.NumberOfSheets-1
            Dim sheet As PoiSheet = poi.GetSheet(i)
            Log(sheet.Name)
        Next
        Dim sheets() As Object = poi.GetSheetNames
        Log(sheets)
       
    End If
End Sub
 

Attachments

  • excel.zip
    2.1 KB · Views: 461
Upvote 0

besoft

Active Member
Licensed User
Longtime User
Thanks for the reply.

Where can I donate ..or otherwise pay off ..:)

Today, late in the evening I will try to read the content of excel file.
 
Upvote 0

ta1dr

Member
Licensed User
Longtime User
hi
I have excel file I want to read cell like a sheet1.cells(1,2) also write
how can I do it ?
 
Upvote 0
Top