Android Question Combine 2 cells in 1 cell B4XTable

manzoor

Member
Help is requested, i want to combine 2 cells value into 1 cell with line-break as shown blow

12.jpg
 
Last edited:

Mahares

Expert
Licensed User
i want to combine 2 cells value into 1 cell with line-break as shown blow
You can use a queryBuilder like this, then display the data. This sample assumes you have 3 columns and remember the internal in memory database uses c0, c1, c2 as column names.

B4X:
Sub btn_Click
Dim l As List
l.Initialize
    Dim o() As Object = B4XTable1.BuildQuery(False)
    Dim s As String =$"SELECT c0, c0 || '${CRLF}'
    || c1 As c01,c2 FROM data
"$  'you are combining the first 2 columns
    o(0)=s
    o(1)= Null
    Dim rs As ResultSet = B4XTable1.sql1.ExecQuery2(o(0), o(1))
    Do While rs.NextRow
        Dim r(3) As String
            r(0) =rs.GetString("c0")
            r(1) =rs.GetString("c01")
            r(2) =rs.GetString("c2")
            l.Add(r)
    Loop
    rs.Close
    B4XTable1.SetData(l)
End Sub
Please do not use: ' Urgent help is requested' in your threads. You will turn people off. You need to give them a chance to answer you
 
Last edited:
Upvote 0

manzoor

Member
Thanks for prompt reply
what is this in coding "[ QUOTE="manzoor, post: 755935, member: 120083"]
i want to combine 2 cells value into 1 cell with line-break as shown blow
[/QUOTE]"
 
Upvote 0

Mahares

Expert
Licensed User
what is this in coding
It is not part of the coding. I accidentally was quoting you inside the B4X code. You were too fast in reading my post See the clean code now after I removed the quote from you. By the way I tested it on my own project and it worked for me
 
Upvote 0
Top