Advanced subtable features

Prev Next

This page covers advanced options for embedded reports (subtables): grouping rows, filtering records, repeating columns, header and alignment settings, and putting a table inside a table cell. It's for users who already have an embedded report working. To create one, see Insert embedded reports (subtable).

Each section links to the Exact Forms Plus Configurator page that describes the option, then covers how it works and the matching text in the Settings field of the Document Subtables record, for users who edit it directly. Settings are separated by commas, so no value can contain a comma.

Group rows in an embedded report

Grouping splits the rows of an embedded report (subtable) by the value of one field. Each group starts with a heading row and can end with a subtotal row. For example, the line items of a purchase order can be grouped by Category, with the total price of each category.

Example

Line items grouped by Category, with Total Price subtotaled, a subtotal label in the first column, and a grand total at the end:

Item

Quantity

Unit Price

Total Price

Hardware

Bracket

20

$4.00

$80.00

Bolt kit

10

$6.50

$65.00

Subtotal

$145.00

Services

Installation

1

$300.00

$300.00

Subtotal

$300.00

Grand total

$445.00

The group field (Category) doesn't have to be a column in the table. Its value appears in the heading row.

Set up grouping in the EFP Configurator

Grouping is set on step 4 of the embedded report, Sorting and Grouping. Every grouping option is described in the Exact Forms Plus Configurator help:

To open an existing report in the configurator, see Create or change an embedded report. After you save, the template doesn't need to change: the same Template Reference value (~strid=N~) picks up the new settings the next time a document is created.

How grouping works

  • Sorting. Rows are sorted by the group field first, then by your other sort fields, so each group's rows are together.

  • Heading row. A heading row is added each time the group field's value changes. It shows the group field's value, or the value of the field you chose in Field to Display for Group, taken from the group's first record.

  • Date fields. If you group by a date field, the heading uses the field's display settings in Quickbase: with the day of the week and month name turned on, for example, it reads Monday, March 22, 2010.

  • Subtotal rows. A subtotal row is added after each group, but only if at least one column has Subtotal turned on. It totals those columns for the group. A label taken from a field uses that field's value in the group's first record.

  • Grand total row. One row at the end of the table, totaling the columns with Grandtotal turned on.

  • Without grouping. Subtotal and grand total columns still work: the table ends with one subtotal row (and a grand total row, if set).

  • Page breaks. With Include Page break after group by, each group after the first starts on a new page.

Grouping in the Settings field

Setting

What it does

Example

groupfid

The field ID to group by, followed by optional parts in this order:

  • - and a field ID: show that field in the heading instead. Put H before the ID if that field contains HTML.

  • :pb: page break after each group.

  • :l, :c, or :r: heading alignment (left is the default).

  • | and the heading font: exactly four parts separated by colons. They are attributes:size:font name:colors, where attributes are any of B, I, U, and colors are background-font. Leave a part empty but keep its colon, for example |B:::#d9e1f2-#000000.

groupfid=17:pb:c|BIU:12:Arial:blue-white
groupfid=12-14

stlist

Field IDs of the columns to subtotal, separated by periods.

stlist=10.14

gtlist

Field IDs of the columns to include in the grand total, separated by periods.

gtlist=14

stlbl

The subtotal label: the column number (counting from 1), a period, and either the text or a field ID. A number is treated as a field ID. The text can't contain a period.

stlbl=1.Subtotal
stlbl=1.12

gtlbl

The grand total label, in the same form as stlbl.

gtlbl=1.Grand total

astl, agtl

Alignment of the subtotal and grand total labels: l, c, or r. Put them after stlbl and gtlbl.

astl=r

sub, total

Colors of the subtotal and grand total rows: a background color, or background-font. Use a color name or an HTML color code.

sub=#eeeeee-#000000

opts

Sort direction. With grouping, add one letter for the group field first, then one for each slist field: A (ascending) or D (descending).

slist=7.8,groupfid=20,opts=sortorder-ADD

The configurator writes the same text without the tildes into Settings.

Grouping limits and known issues

The limits shown in the configurator (one group field; no commas or periods in labels) are on Sorting, grouping, and totals. Also:

  • You can't group by a field that contains HTML. You can still show an HTML field in the heading with Field to Display for Group.

  • Summary reports (Summary and Master Summary embedded reports) keep the grouping of the saved report. Don't add grouping to their Settings field by hand, and don't take their grand total label from a field: the document isn't created.

  • Repeat columns can't be grouped. See Repeat columns.

  • If your first sort field's ID begins with the group field's ID (for example, grouping by field 6 and sorting by field 61), rows may not stay together and the heading can repeat. Add the group field as the first sort field yourself (slist=6.61).

Filter the records in an embedded report

The filter decides which records appear in the table.

In the EFP Configurator

Filters are set on step 2 of the embedded report, Filter Criteria. The conditions, operators, what you can compare against, and the pre-filled filter for related tables are described in Filtering Criteria. The maximum number of records, skipping records, and new/updated records are in Advanced Filtering Criteria.

Master record fields used in a condition are added to the template's field list automatically when you save.

Filtering in the Settings field

Setting

What it does

Example

qry

The filter, in Quickbase query syntax, for Detail reports. Join conditions with AND or OR. To use a value from the master record, put the master field's name in square brackets. See Values from the master record.

qry={'6'.EX.[Record ID#]}AND{'10'.EX.'Active'}

type

d Detail (the default), s Summary, or ms Master Summary.

type=ms

qid

The saved summary report to show, for Summary and Master Summary reports. It isn't used by Detail reports, so a Detail report always needs qry. Use either qid or qry, not both: if both are present, only the first one is used.

qid=12

sqry

An extra filter on the rows of a summary report, in Quickbase query syntax, using the report columns' field IDs. To use a master record value here, put the master field's ID in square brackets.

sqry={'8'.EX.'[15]'}

opts

Detail reports only. Quickbase query options, separated by periods: num-n (at most n records), skp-n (skip the first n), onlynew, and sortorder- (see Grouping in the Settings field).

opts=num-10.sortorder-D

Values from the master record

  • Use the master field's exact name, with the same capitalization, in square brackets: [Customer Name]. If the name doesn't match, it isn't replaced and the report usually finds no records.

  • The field must be in the template's field list (clist). Record ID# is always available. The configurator adds fields you pick in the filter; if you write the filter by hand, add the field yourself.

  • The value is inserted as it's displayed: numbers with thousands separators, dates in the app's date format. Quotes aren't added for you, so put them around text values: {'7'.EX.'[Customer Name]'}. Comparing on Record ID# or a related-record field is the most reliable.

  • Values that contain an apostrophe can break the filter, so the report shows no records.

Filtering limits

The limits shown in the configurator (your account's record limit, no commas in filter values, no crosstab reports) are on Create or change an embedded report. If a report finds more records than your account allows, use a lower Maximum Number of records to return, a narrower filter, or the Exact Forms Plus Batch Processor.

Repeat columns

Repeat columns lay records out across the page instead of down it. The setting is Repeat Columns on step 5 of the embedded report; see Miscellaneous Options. In the Settings field it's rpt= and the number of copies, for example rpt=3.

Example: a report with the columns Part and Qty, with columns repeated three times, showing seven records:

Part

Qty

Part

Qty

Part

Qty

A-100

4

A-110

2

B-200

6

B-210

1

C-300

3

C-310

8

D-400

5

Each copy has its own column headings. Row shading (Row Shading and Alternate Row Shading) still applies to each row.

With repeat columns, these options don't work:

  • Grouping, subtotals, and grand totals. Don't set a group field on a report with Repeat Columns: the configurator saves both, and the grouping and totals are ignored. If Include Page break after group by is also set, no document is created.

  • Dynamic Row Shading and the item counter (Include Item Counter).

  • Custom date formats in columns.

  • Blank column headings: NULL is printed as the word NULL instead of an empty heading.

Column headings and alignment

In the configurator, the options for all columns are on step 5, Table formatting options (Column headers, Table Alignment, and Miscellaneous Options). The options for one column are in its Advanced Settings on step 3. The table below gives the matching text in the Settings field, and the default when it's left out.

Option

In the Settings field

Default

Alignment of all column headings

ahdr=l, ahdr=c, or ahdr=r

Center

Alignment of one column's heading (overrides the setting for all headings)

The 4th part of the column in clist, after the heading text: LT6:200:Task:l

The setting for all headings

One column's heading font

After a second | in the column: LT6:200:Task:l|I|BU:11:Arial (the first | part is the data font)

Bold, in the template text's font

Horizontal alignment of a column's values

The first letter of the column: L, C, R, or J (justify): R$13:75

Required in every column

Vertical alignment of a column's values

An optional third letter, T, M, or B: LTM6:200

Top

Position of the table on the page

align=l, align=c, or align=r

Center

Heading row colors

hdr=background or hdr=background-font: hdr=#1f4e79-#ffffff

Light gray background; the template text's font color

Hide the heading row

noheader

Shown

New page every n rows

pagebreak=20

Off

Keep each row on one page (not in the configurator)

nobreakacrosspages

A tall row can split across pages

With pagebreak, each page's rows are a separate table with its own heading row.

Put a table inside a table cell

An embedded report in a cell of your template

You can lay out a page with a Word table in your template, for example two columns side by side, and paste a Template Reference value (~strid=N~) into one of its cells. Exact Forms Plus replaces it in the same way as anywhere else in the document, so the embedded report appears inside that cell. Keep the value on its own line in the cell, set the report's column widths so the table fits the cell, and check a test document before using the template.

An embedded report inside another embedded report

Exact Forms Plus has no built-in option to show a second embedded report in each row of the first, for example the tasks of each project in a list of projects. You can get this result with a formula field, but it isn't a supported feature, so test it carefully before you rely on it:

  1. In the outer report's table (for example Projects), create a Formula - Text field that builds the inner report's settings, including the row's own Record ID#. For example:

    "~dbid=bxxxxxxxx,qry={'12'.EX.'" & ToText([Record ID#]) & "'},clist=LT6:150.RN7:60~"

    Here bxxxxxxxx is the inner table (Tasks), field 12 is its reference to the project, and the clist lists the inner columns.

  2. Add that field to the outer report as a Text column. To leave its heading blank, use NULL as the heading.

  3. When the document is created, the outer report fills each cell with that settings text, and Exact Forms Plus then builds an inner table in each cell.

Things to know:

  • The inner table's values from square brackets ([Field Name]) come from the document's master record, not the outer row. That's why the formula builds the row's Record ID# into the text.

  • A ~strid=N~ value doesn't work here. The full settings text, starting with ~dbid=, is required.

  • Each inner table is a separate request and counts separately toward your account's record limit, so large outer reports are slow.

  • The inner table uses the outer cell's font. Settings can't contain commas.

  • Never let an inner report show the same formula column again. The tables would keep nesting, and the document wouldn't finish.

See also: Insert embedded reports (subtable), Exact Forms Plus Configurator overview, Troubleshooting.