B4A Library [Class] Flexible Table

Eric McDonald

Member
Licensed User
Sorry, I hadn't read your post deeply enough.
It is not possible, in the current version, to append the table content to an existing *.csv file.
The SaveTableToCSV routines are based on the StringUtils library which doesn't allow to append data.
To append data you need to write your own routine.
B4X:
    If Register_CellClick(sCol,sRow) = False Then
        Log("Error")
    Else If Register_CellClick(sCol,sRow) = True Then
        Dim FullString As String
        Dim MyTextWriter As TextWriter
        MyTextWriter.Initialize(File.OpenOutput(File.DirRootExternal, "test.csv",True))
        newID = register.GetValue(0,sRow)
        newPO = register.GetValue(1,sRow)
        newCust = register.GetValue(2,sRow)
        newComm = register.GetValue(3,sRow)
        FullString = newID & "," & newPO & "," & newCust & "," & newComm
        MyTextWriter.WriteLine(FullString)
        MyTextWriter.Close
        Log("Success")
    End If
I was able to find a solution to this issue
 

klaus

Expert
Licensed User
I was able to find a solution to this issue
I didn't doubt about that.
That's why I wrote in my last post 'To append data you need to write your own routine'.
 

fishwolf

Well-Known Member
Licensed User
Thank you for reporting this bug.
The Class has been updated to version 3.09 in the first post.
Thanks, but with this version and FirstColumnFixed = true the last column is showed for half size

is it possible have a parameter for set the number of fixed columns?
 

klaus

Expert
Licensed User
Thanks, but with this version and FirstColumnFixed = true the last column is showed for half size
On my device it works OK.
Can you post your project, so I can look what exactly happens.
is it possible have a parameter for set the number of fixed columns?
No, not in this version and not in my pipeline.
 

fishwolf

Well-Known Member
Licensed User
Sorry

but with FirstColumnFixed=True doesn't work the header align

B4X:
Dim Alignments() As Int
 Alignments = Array As Int(Gravity.LEFT, Bit.Or(Gravity.LEFT, Gravity.CENTER_VERTICAL), Gravity.CENTER, Gravity.LEFT, Gravity.LEFT, Gravity.LEFT, Gravity.LEFT, Gravity.LEFT, Gravity.LEFT, Gravity.LEFT)
 Table1.SetHeaderAlignments(Alignments)
 Table1.SetCellAlignments(Alignments)
[code]
 

Attachments

klaus

Expert
Licensed User
I tried your project.
Unfortunately, it doesn't work.
You have three lines like this cRowColor3 = Props.Get("Row3Color") in DesignerCreateView.
But you don't have the equivalent #DesignerProperty: Key: Row3Color, DisplayName: Row 3 color, ... lines !?
Do you have a working project?

Are you sure that it works with the lazy loading method?
 

fishwolf

Well-Known Member
Licensed User
I tried your project.
Unfortunately, it doesn't work.
You have three lines like this cRowColor3 = Props.Get("Row3Color") in DesignerCreateView.
But you don't have the equivalent #DesignerProperty: Key: Row3Color, DisplayName: Row 3 color, ... lines !?
Do you have a working project?

Are you sure that it works with the lazy loading method?
Sorry, i have attach the original project and example for custom color
 

Attachments

fishwolf

Well-Known Member
Licensed User
other question:
i used a old version (1.11) and now migrate to last version

old version when the text are long, go to a new line, le new version not
is it possible replicate this feature on last version?

Thanks
 

Attachments

klaus

Expert
Licensed User
Now, I got it to run.
There were two problems.
I first load your test project from post#936 and then copied the Table.bas file to my demo program..
There were these lines missing:
#DesignerProperty: Key: Row3Color, DisplayName: Row 3...
Added those, but then I got another error. So i stopped.
Then I tested your project from post#938, it worked.
I copied the Table.bas file to my demo program and got the same error as before.
I found the error:
In Table.bas, line 2432 cTypeFaces = TypeFaces must be cTypeFaces0 = TypeFaces.
I checked my Table.bas file from version 3.11 and that line was OK. Don't know when nor why the '0' was removed.

Another problem is the new AddRow method. As its signature has changed it is not backward compatible.
I renamed it to AddRow2 and added a new AddRow routine with the original signature to be backward compatible.

I will further work on it.
I have some other ideas.
 
Top