Enhanced vs Regular Tabular Fields
Advantages over regular tabular fields include:
- Field Options are supported. Most regular types can be used; Images, Hyperlinks, Barcodes, etc.
- Multiple level sorting. Sorting is a global property for each Tabular Field.
- Rather the relying on a ‘Computed Field’ command to determine linked content, the field name includes all the elements required.
- Menu options like Replace Fields and Update Document->Panel Selection are supported.
- Tables are populated using the same method as regular table, so cell merging, etc work exactly the same.
- Table filters can be used to selectively populate content.
- Enhanced tabular fields can be nested inside each other.
- Automatic field generation for structured field types (JSON, XML).
Configuring
Taking the example field content below. Copy this into a test field and set the type to be Tabular using the field content using a column delimiter of | and a row delimiter or ^p.
1 2 3 4 5 6 7 8 9 10 11 | Product|Brand|Category|Price|Description Smartphone|Samsung|Electronics|799.99|5.8' display, 128GB storage, 12MP camera Running Shoes|Nike|Footwear|129.99|Men's size 10, black and white design Coffee Maker|Keurig|Kitchen Appliances|89.95|Single-serve, programmable, 12oz reservoir Backpack|The North Face|Outdoor Gear|79.99|30L capacity, water-resistant, padded straps Wireless Headphones|Sony|Electronics|199.99|Noise-cancelling, Bluetooth, 30-hour battery life T-shirt|Adidas|Apparel|24.99|Cotton, crew neck, logo print Frying Pan|Calphalon|Cookware|39.95|Non-stick, 12-inch diameter, oven-safe handle Book|HarperCollins|Books|14.99|Bestselling novel, fiction, paperback Yoga Mat|Lululemon|Fitness Accessories|69.00|Eco-friendly, non-slip, 5mm thickness Smart Watch|Apple|Wearable Tech|299.00|GPS, heart rate monitor, water-resistant |
Tabular fields are configured via the Field Options, so we can right click on “Tabular Value” in the data panel and set it to be a “Tabular” format field with the “Type” of “Enhanced”. Other settings used in this example are shown here. Ensure the type is Enhanced and the Column ID is Column Content(Top). Since the table includes unique field names in the first column.
The press “Configure…” and define the delimiters used in the data:
Column Identifiers
It’s essential to verify whether the first row contains a valid Column ID, as it could serve as the field’s name. If it does, label it as “Column Content Top.” For consistency, all values must be unique, non-empty, and free of “[” or “]” characters, which are reserved for the linking mechanism. A valid Column ID simplifies identifying fields in dialogs and menus. By default, the Column ID corresponds to the column’s index, starting from 0 and going up to ‘n’. When the Column ID is set to “Column Content Top,” the result is:
Row Identifiers
If the table has a column that contains a key, this can be used in place of the default row index. In this example, the first column on the left, which contains the values from the Product column, is used. Similar to Column IDs, these values must be unique.
Field Options
Once setup, Right clicking a field in the data panel allows the Field Options to be edited. The field options pop-out menu also list the names of any visible tabular fields.
Linking Mechanism
With Enhanced tabular fields, the field name element of a link identifies which cell the data belongs to. The following example illustrates a single link once inserted:
Inspecting the Computed Field Panel reveals a field name of Tabular Value[Product][Coffee Maker]
This breaks down as:
- Tabular Value – Name of the Parent field.
- [Product] – Column ID. Identifies which column the data comes from.
- [Coffee Maker] – Row ID. Identifies which row the data comes from.
Nesting
Another Advantage is the ability for Tabular Fields to contain Tabular Fields. In the example data, the Description field is a comma separated list which can be configured as another delimited tabular field. Setting Tabular[Description] up like this way results in:
In this case the data doesn’t contain named columns, so the default is used (indexes). Inspecting the Computed Field panel reveals a field with the name of:
Tabular Value[Decription][Coffee Maker][0][1]
Breaking this down:
- Tabular Value[Decription][Coffee Maker] – Identifies the parent field.
- [0][1] – [0] is the Column ID within the parent tabular field, [1] is the Row ID.
Populating Tables
When selecting and inserting a parent tabular field or multiple cells of a tabular field, a table gets created with the selected content. When a table is created it automatically gets a property to indicate which tabular field the rows in the table map to:
Selecting the tabular field the top level and inserting it gives the following, with the description tables fields created as tables inside the parent:
The table is set to Expand Vertically with Tabular Records from Tabular Field[Description]
Using Containers
General Overview
When configuring a formatting rule, you can set its usage to either “Once Per Record” or “Once Per Group.”. If the “Group Name” matches an Enhanced Tabular Field Name, the rows in that tabular field become records. The usage then defines how these records are used:
Once Per Record: A single record for each row in the tabular field.
Once Per Group: A set of records for all rows in the tabular field.
Example Formatting Rule Repeated Once For Each Record
Rather than a table in the Description column, you may want individual elements for each row. The Formatting Rules inside the Container needs to be configured to populate data from the tabular field. In this case we setup a yellow frame with a field specifier:
In the Formatting Rules settings dialog, we need to tell it where it should be used. in this case Once for each record in Tabular Value[Description]
Now we define prototype table with a Container in the Description column:
Once this is setup, populating the table with the top level gives:
Using Nested Containers with Tabular fields.
Here’s a more complex example, which uses a nested Container:
The First is the yellow frame as the previous example, configured with a Usage of “Once Per Record” and a Group Name “Tabular Value[Description]”
The second is Formatting Rule which includes a Container for above, which has a Group Usage name of “Tabular Value”. It’s import this is set to resize vertically in this example. This is also set not to split.
The above example is created when this formatting rule is assigned to Container and populated.
Field Options Storage
The field options are stored hierarchically in the Fields.xml file. Only fields that have been edited are stored. It’s worth noting that once a fields options have been edited, it will be persisted permanently (the field may be removed from the data and later reappear). This could lead to an excessive amounts of data if the Column IDs are ad-hoc or change regularly. Use column indexes in this case to avoid this issue.
Advanced Formatting
Post processing can be used to format cells that fields appear in. For example, when the Product field appears in a table cell, we may want to apply a cell style to it. The cell options move with the field, so it doesn’t matter where the field appears in the table, the setting from the tabular cell are applied. Certain commands aren’t supported such as setting the row and column span, but the majority formatting options are available.
Creating a prototype table with the Product column in a different position results in the cell style from the original tabular field being applied to the correct column:
Automatic field generation for structured (JSON, XML) field types.
When an Enhanced Tabular fields content type is JSON or XML, EasyCatalog will automatically create child tabular fields. Take a field containing the following example JSON:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | { "person": { "name": "John Doe", "age": 30, "address": { "street": "123 Main St", "city": "New York", "state": "NY" } }, "job": { "title": "Software Engineer", "company": { "name": "TechCorp", "location": "San Francisco" } } } |
Expanding this field results in:
Now create an empty Container, select the top level field and use the Insert button in the panel, this is results in the Container getting populated with the entire structure as a set of nested Containers. These are created automatically and can be used as the basis for further refinement: