Populate EditTable (OpenInsight Specific)
At 07 FEB 2002 08:06:05PM Roman wrote:
How can I populate an Edit Table control with
data from native OI table?
Thanks in advance,
Roman
At 07 FEB 2002 09:17PM Scott, LMS wrote:
To display multivalue fields from a record in an OI table, The usual way is to set the database association property of the edit table. You set the table and for each field you want displayed, associate a column from the edit table with it.
To display the whole OI table in the edit table, you will probably need to create a form that isnt bound specifically to a table, then write some code that you run from the create event to read records, and set the ARRAY property or LIST property of the edit table.
There are limits on how many rows will display at once in the OI 16 bit version. I don't know of any way of getting an edittable to just display all the rows from an OI table the way you can with something like MS Access. You can write your own code to do it with OI.
To get the most rows to display in the edit table at once, under the more button in the edit table properties, set the row limit to -1. This then uses the computer's RAM to facilitate how many rows display. I think the limit is still around 50K of formatted data for this. Ie if you do
void=SET_PROPERTY(@WINDOW : ".LMS_EDITTABLE", "ARRAY", lms_table_data)
the LEN(lms_table_data) needs to be less than 64K but more like less than 50,000.
If you do write your own code for loading and paging data from a table on a form, I recommend you use a commuter event to do it, rather than coding directly into the edittable and form event scripts.
Scott, LMS
At 08 FEB 2002 05:02PM b cameron wrote:
Some Options…
1) if you just want to show columns and rows from a table you could use the User Interface to populate a popup.
2) set associations by double-clicking the edittable in form designer.
In the edit table properties window, choose your column then in the bottom right corner click 'Set' choose the table then the column/field to associate. Do that for each column
3) set it programatically. The easiest example I can think of is
do an XLATE of your multivalued field (ie. string=1]2]3]4]5 (]=@VM) )
If you set_property "ARRAY" of the edittable then think of columns
as a string of multivalues. If set_property "LIST" then think rows as a string of multivalues.
So for Set_Property(@WINDOW:".EDITTABLE,"ARRAY",String) would give you 1 2 3 4 5 down in column 1.
A Set_Property(@WINDOW:".EDITTABLE,"LIST",String) would give you 1 2 3 4 5 across row 1
Most edittables on a bound form are used with associated multivalues in A that's one record but you can code to fill in all items by looping through the table and apply as in option 3.
There are 64k limits to consider with OI16 and if you just need a popup I would highly recommend the UI to build the table popup.
Hope this helps.
At 11 FEB 2002 06:03PM Roman wrote:
Many thanks to both Scott and b cameron.
I am new to OI development and
your suggestions did help me a lot!
With best regards,
Roman