Android Tutorial two dimensional database/reports

Discussion in 'Tutorials & Examples' started by anuj0sharma, Apr 11, 2011.

  1. anuj0sharma

    anuj0sharma Member Licensed User

    Hello Everyone,
    wants to have a two dimensional database.
    Is it feasible using the great DBUtils by Erel.

    the table should look like this..

    [​IMG]

    if, storing in 2D is not possible, then how can we use DBUtils with webView to generate similar looking report.

    any suggestions are welcome.

    Regards,
     

    Attached Files:

    • db.jpg
      db.jpg
      File size:
      15.3 KB
      Views:
      718
  2. Erel

    Erel Administrator Staff Member Licensed User

    DBUtils.ExecuteHtml creates Html tables. Using DBUtils you can create the required database and then display such a table.

    Code:
    Sub Process_Globals
        
    Dim SQL As SQL
    End Sub

    Sub Globals

    End Sub

    Sub Activity_Create(FirstTime As Boolean)
        
    If FirstTime Then
            
    SQL.Initialize(File.DirRootExternal, "1.db"True)
        
    End If
        
    Dim m As Map
        m.Initialize
        m.Put(
    "Device", DBUtils.DB_TEXT)
        m.Put(
    "Param 1", DBUtils.DB_TEXT)
        m.Put(
    "Param 2", DBUtils.DB_TEXT)
        m.Put(
    "Param 3", DBUtils.DB_TEXT)
        DBUtils.DropTable(
    SQL"devices")
        DBUtils.CreateTable(
    SQL"devices", m, "Device")
        
    Dim List As List
        
    List.Initialize
        
    For i = 1 To 100
            
    Dim values As Map
            values.Initialize
            values.Put(
    "Device""Device " & i)
            values.Put(
    "Param 1", i)
            values.Put(
    "Param 2", i * 3)
            values.Put(
    "Param 3", i * 5)
            
    List.Add(values)
        
    Next
        DBUtils.InsertMaps(
    SQL"devices"List)
        
        
    Dim wv As WebView
        wv.Initialize(
    "")
        
    activity.AddView(wv, 00100%x100%y)
        wv.LoadHtml(DBUtils.ExecuteHtml(
    SQL"SELECT * FROM devices"Null0))
    End Sub
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    Screenshot:

    [​IMG]
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice