Tabular field cells normally contain text, which has limited formatting. To overcome this fields can be assigned to individual cells:
1 2 3 | t = TABLE.new(); t:cell(1,1):setcontent(FIELD.get('Category')); t:present(); |
For group tabular fields, the tableof method returns a table with fields automatically assigned. Take this data for example:
1 2 3 4 5 6 7 8 | Sku, Group, Images 1, Social, twitter 2, Social, facebook 3, Media sharing, flickr 4, Media sharing, instagram 6, Media sharing, pinterest 7, Social, linkedin 8, Blogging, tumblr |
In this example, we’ll create a custom field to collect all the Images for each Group into a table. This is achieved by defining the Group Path of the tabular field to be Group, then using the following command:
1 | RECORDSET.getgroup():tableof("Images"):present(); |
The getgroup() method returns a set of all records in the group and tableof() returns a table containing image fields. The Image Group then has Formatting Rule assigned as follows to repeat for each row in the table:
When the field is inserted, it attempts to insert the Formatting Rule called image for each row in the table. The Formatting Rule is a just picture box tagged with the name of the field. When the field is inserted, this result in:
By assigning a row option to the table to populate once per Group, the following result can be achieved: