Produce documents

Layouts that hold as line items grow

Created: Updated:

When there are more line items than the document has room for, the template's "When there are many line items" setting decides what happens. "Duplicate pages" carries on to the next page, "Fixed (extra rows are dropped)" outputs only what fits, and "Add rows" stretches the table. Sorting, last-page totals, grouping and the vertical direction can be combined with them.

Sometimes a record has more line items (a kintone subtable) than the document’s line-item area can hold. What happens then is decided by the template’s “When there are many line items” setting. There are three modes, and your administrator chooses one to suit each document.

The three modes

Mode Suits What happens
Duplicate pages Slips and forms with a set number of line-item rows per page, such as delivery notes and invoices When the items do not fit, the whole print-area page is copied below and the list carries on. Fixed text, formatting, merged cells, row heights and images appear on every page, the print area grows to the last page, and a page break is placed between pages
Fixed (extra rows are dropped) Documents whose area must not change size or position, such as order forms Only as many rows as the template’s line-item area are written. Extra items are not output, and no other cell moves
Add rows Invoices and delivery notes whose line items grow and shrink with the count One block per line item is created. Formatting, merged cells, row heights, fixed text and formulas are copied, and the cells below the items move down

Which mode a document uses is set by the administrator who registered the template. If the output is not the shape you expect, ask them to read Set up subtable (line item) layout.

Settings you can combine

These settings can be combined with the three modes.

Sorting

Sets the order of the line items. You can sort by several fields, applied from the top (for example customer ascending, then date ascending within the same customer). It works with all three modes. If both values being compared read as numbers, they are compared by size; otherwise they are compared as text. Items with the same value stay in their original order.

Show the total on the last page only

When “Duplicate pages” produces several pages, a cell that should appear only once at the end, such as a total, can be set to “Show on the last page only (when output spans several pages)”. On every other page that cell stays empty. This setting is used where a single cell is mapped to a field.

Formulas such as SUM that you place at the bottom of a page are copied to each page, and their references shift by the rows of that page.

Grouping

With “Add rows”, separator rows are inserted where a value changes, such as the customer or the month. The separator is made from the “total” row and the “heading” row you prepared in the template. A separator is inserted wherever the value differs from the previous item, so sort by the same field first. Grouping works only when one line-item mapping uses those rows.

Vertical

With the line-item direction set to “vertical”, one item takes one column and items are added to the right. Use it for documents such as a monthly trend table with one column per month. With “Add rows”, columns are added, and column width, formatting, merged cells and fixed text are copied. With “Duplicate pages”, the items carry on in the same columns on the next page, and with “Fixed (extra rows are dropped)”, only the items that fit in the template’s columns are output.

Neighbouring line items grow together

Several line-item mappings whose rows overlap grow together as one block with “Add rows”.

Which setting to choose

When Choose
The list should carry on to the next page, with the total on the last page only “Duplicate pages” + “Show on the last page only”
The area must not change size or position, and extra items need not appear “Fixed (extra rows are dropped)”
The table should stretch to the number of items “Add rows”
You want a break wherever a value changes, such as per customer “Add rows” + grouping (sort by the same field first)
Months should run to the right Line-item direction “vertical” + “Add rows”
The items should be in a set order Sorting (works with every mode)

The setup steps and worked examples for each kind of document are in Set up subtable (line item) layout. How this differs from combining the records filtered in a list view into one document is explained in Set up aggregate export.

Things to watch

  • With “Fixed (extra rows are dropped)”, items beyond the area do not appear on the document. Export one to check that all your items fit.
  • With “Add rows”, include the blank row after the last item in the range of a total formula (SUM) below the items, for example SUM(B10:B11). If you do not, the range of the total does not widen as rows are added.
  • “Duplicate pages” copies images to each page; shapes (auto-shapes) are not copied.

Frequently asked questions

What happens when the line items do not fit on one page?

The template's "When there are many line items" setting decides. "Duplicate pages" carries on to the next page, "Fixed (extra rows are dropped)" outputs only what fits, and "Add rows" stretches the table to the number of items.

The total appears on every page.

Turn on "Show on the last page only (when output spans several pages)" for the total cell, and it stays empty on every page except the last. Ask your administrator to set it.

The line items stop partway and the last few are missing.

With "Fixed (extra rows are dropped)", items beyond the number of rows in the area are not output. Changing to "Duplicate pages" or "Add rows" outputs all of them. Ask your administrator to change it.

Can I change the order of the line items?

Yes. Sorting can be set on the template. You can sort by several fields in turn, and it works with all three modes.

Written and maintained by: TechJapan LLC (PRING team) (Developer and operator) · Contact