PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → Table with variable/flexible amount of columns
Table with variable/flexible amount of columns
Iniciado por Sebastian Arnold, 28,may. 2015 15:03 - 1 respuesta
Miembro registrado
102 mensajes
Publicado el 28,mayo 2015 - 15:03
I'm trying to show a table from CSV data.

1. Loading the file into memory with fOpen() and fRead()
2. Building an array with csvtoarray()


Now I want to fill a table in my window with the data from my array. I have a table with one column which represents the row id.

Then I am able to add columns to the table with ControlClone. I can change the column title with an indirection like this

{"TABLE_data.COL_"+i}..Title = garrData[1,i]


But I don't see how to add the data with for example TableAddLine() since I don't know the number of parameters in advance!

How are you doing tables with a variable/flexible amount of columns?

TIA
Sebastian

--
--
http://arnoldconsult.de
Publicado el 28,mayo 2015 - 16:26
Hi Sebastian

just use indirection to add your data: ad an empty line with
tableaddline, then loop on the column names with indirection

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

Already there: WXShowroom.com, WXReplication (open source)
Coming soon: WXEDM (open source)
More information on http://www.fabriceharari.com


On 5/28/2015 7:03 AM, Sebastian wrote:
I'm trying to show a table from CSV data.

1. Loading the file into memory with fOpen() and fRead()
2. Building an array with csvtoarray()


Now I want to fill a table in my window with the data from my array. I
have a table with one column which represents the row id.

Then I am able to add columns to the table with ControlClone. I can
change the column title with an indirection like this

{"TABLE_data.COL_"+i}..Title = garrData[1,i]


But I don't see how to add the data with for example TableAddLine()
since I don't know the number of parameters in advance!

How are you doing tables with a variable/flexible amount of columns?

TIA
Sebastian

--
--
http://arnoldconsult.de