Android Question B4xTable.SetData error

Discussion in 'Android Questions' started by makis_best, May 9, 2019.

  1. makis_best

    makis_best Active Member Licensed User

    Hello all

    I try to pass a list to b4xtabe using

    Code:
    B4XTable1.SetData(ItemList)
    But when I run the application I get the error

    Why?
    What it means?
     
    Last edited: May 9, 2019
  2. makis_best

    makis_best Active Member Licensed User

    Anyone?
     
  3. José J. Aguilar

    José J. Aguilar Active Member Licensed User

    mangojack likes this.
  4. Erel

    Erel Administrator Staff Member Licensed User

    Each item in the list should be made of an array of objects. One object (number or string) per column.

    Based on the error message you haven't built the list correctly.
     
  5. makis_best

    makis_best Active Member Licensed User

    I create the list using this code-->
    Code:
    Dim N As ItemType
                N.But = 
    ""
                N.OrderNum = Main.General1.OrderNum
                N.Gid = Main.General1.Client_GID
                N.LineAA = Main.General1.LineAA
                N.Code    = ItemTable_All_Items.GetValue(
    0,row)
                N.Description = ItemTable_All_Items.GetValue(
    1,row)
                N.Munit = ItemTable_All_Items.GetValue(
    2,row)
                N.Price = ItemTable_All_Items.GetValue(
    3,row)
                N.Quantity = ItemTable_All_Items.GetValue(
    4,row)
                N.Perc1 = Main.General1.Percent1
                N.Perc2 = Main.General1.Percent2
                N.AxiaProEkptosis = Total1
                N.KathariAxia = KathariAxia
                N.PosostoFPA = Main.General1.VatPercent
                N.AxiaFPA = AxiaFPA
                N.Comment = 
    ""
                ItemList.Add(N)
    I can't have type into list?
     
    Last edited: May 10, 2019
  6. makis_best

    makis_best Active Member Licensed User

    Ok... I work over it 9 days now and I can't figure out.

    Any help?
     
  7. José J. Aguilar

    José J. Aguilar Active Member Licensed User

    Have you tried with an array?

    Data is a list. Each item in the list is an array of objects that represents a row.
    Example
    Code:
    Dim data As List
    data.Initialize
    data.Add(
    Array(123))
    data.Add(
    Array(456))
    B4XTable1.SetData(data)
     
    Peter Simpson and Erel like this.
  8. Erel

    Erel Administrator Staff Member Licensed User

    As written several times above, each item in the list must be an array of objects.
    No.
     
  9. makis_best

    makis_best Active Member Licensed User

    Ok....

    I understand..... So no point to use type in my code.
    I change my code to fit needs of b4xtable.
    Thank you.
     
  10. José J. Aguilar

    José J. Aguilar Active Member Licensed User

    What about something like:
    Code:
    data.Add(Array(N.OrderNum,N.Gid,N.LineAA, ...))
    Remember that there are currently three types: TEXT, NUMBERS and DATES.
     
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