PlugBits
PlugBits Plugins & Extensions for kintone
← Back to Excel Report Batch Generator

Excel Report Batch Generator Manual

This plug-in merges list view records into an Excel template and bulk-generates xlsx documents. By default, selected records are output stacked vertically on a single sheet (you can also switch to one sheet per record).

1. What this plug-in does

2. System requirements

Intended for use in a PC browser (latest version of Chrome/Edge). Not supported on kintone mobile (the mobile app or mobile view).

3. Applicable version

This manual covers version 2.4.2.

4. License (trial and purchase)

This is a paid plug-in. A "License (Paid Version)" section appears at the top of the configuration screen.

License section

5. Opening the configuration screen

  1. Open the target app (the app containing the records you want to output to Excel).
  2. Open the App Settings.
  3. Open "Plug-ins," then click the settings icon (gear) for "Excel Document Bulk Generator."

6. Preparing a template

6-1. Where to store the template

In "1. What do you want to create?" on the configuration screen, choose one of three locations for the template.

Location Description
Template app (recommended) Loads the Excel template from a separate kintone app used to manage templates. Best suited if you want to switch between multiple documents.
Attachment field on this app Attaches the template to each record of the target app. Best suited if you want to use a different template per record.
Fixed URL (legacy setting) Shown only for apps that had a fixed URL configured in an earlier version. Not selectable for new configurations.

If you select Template app, enter the following items (the defaults are usually fine):

Setting Description Default
Template App ID ID of the app that manages the templates (Required; e.g., 255)
Template Code to Use Code identifying which template to use. Enter the exact value of templateCode (or whichever field you've renamed the template code field to) from a record in the template app (Required; e.g., WI_LABEL)
Template Attachment Field Code Attachment field in the template app templateFile
Template Code Field Code Field in the template app that holds the code templateCode
Status Field Code Field used to determine enabled/disabled status
Active Status Value Value that marks this template code as "usable" ACTIVE

If you don't have a template app yet, click the "Create Template App" button below "Template App ID" to automatically create a new app called "Excel Document Templates," containing three fields: templateCode (single-line text), templateFile (attachment), and status (drop-down, ACTIVE/INACTIVE) (the field codes used are whatever is currently entered in the Template Attachment Field Code / Template Code Field Code / Status Field Code boxes at that time). Once creation finishes, the app ID is filled in automatically in "Template App ID." Then open the template app, register one template record (an Excel file), and finally make sure to click "Save" on this configuration screen. If you don't have permission to create apps, you'll get an error — ask your kintone administrator, or create the app manually as described in the table above.

Example template app (the "Quote Template" app in our internal test environment):

Template app record

As shown above, register one template per record in the template app. It works as long as it has three items: templateCode (e.g., QUOTE_STANDARD), status (ACTIVE), and templateFile (the attached Excel file). You can register multiple templates — for documents and for labels, for example — as separate records, and specify on the target app side which code to use.

6-2. Writing merge tags

In the cells of your Excel template, write tags marking where values should be merged in. There are two notations, old and new, and both work.

New notation (recommended: single curly braces)

Notation Meaning
{field code} Merges that record's value directly. Example: {CustomerName} {Subject} {QuoteDate} {Total}
{Table.Field} A line item row. Any row containing this notation is automatically recognized as a "line item row," and is repeated downward for the number of rows in the table. Example: {LineItems.ItemName} {LineItems.Quantity} {LineItems.UnitPrice} {LineItems.Amount}
{detailNo} Automatically filled with the line item's sequential number (starting from 1).

If any row in a contiguous block contains {Table.Field}, that whole block of rows is treated as a line item block and repeated. As rows are repeated, merged cells, print areas, page breaks, and images located below (such as a totals row) automatically shift down to match. If the content inside { } is an unrecognized name, it's left as plain text with no action taken (the template won't break).

QR images and barcodes are not supported with single curly braces (e.g., {QR:tag}). Always write these with double curly braces ({{QR:tag}} {{BC:tag}}) (see "Alternate notation" below).

Alternate notation (double curly braces)

Notation Meaning
{{tag}} Converted to a field value or an auto-generated value using the mapping table in "Merge Items" on the configuration screen. Example: {{partNumber}}
{{QR:tag}} / {{BC:tag}} QR code image / barcode image

The {{tag}} notation is intended for Label mode and for templates you've been using from before. For new templates, we recommend the new {field code} notation.

6-3. Example of building a template

The following uses "Quote Template.xlsx" from our internal test environment as an example (this example is used with Document mode and the default "stack vertically on a single sheet" output).

Row/Cell Content
A1:E1 (merged) Title "Quote"
A3:C3 (merged) Recipient "{CustomerName}"
D3:E3 (merged) Date "Quote Date: {QuoteDate}"
A4:E4 (merged) Subject "Subject: {Subject}"
Row 5 Line item header row: "No. / Item Name / Quantity / Unit Price / Amount"
Row 6 (repeated) Line item row: "{detailNo} / {LineItems.ItemName} / {LineItems.Quantity} / {LineItems.UnitPrice} / {LineItems.Amount}"
Row 7 Totals row: "Total / {Total}"

The key is row 6 alone. Writing a {Table.Field} entry such as {LineItems.ItemName} in this row causes it to be automatically duplicated to match however many rows are in the record's line items (subtable), regardless of count. The totals row (row 7) automatically shifts down as the line items grow, so there's no need to design the template around a fixed number of line item rows. The print area is also adjusted automatically to match the template's print area settings.

In the same way, you can also build a simple template containing just a small label (part number, quantity, QR code, etc.) for use with Label mode.

7. Setting 1: What do you want to create? (output mode and template location)

Configuration screen: output mode and template location

8. Setting 2: Verify the mapping between the template and fields

Once you've entered your settings, you can use this screen to check whether all the template's merge tags are mapped correctly.

  1. Either choose a local xlsx file with "Select and check a local Excel file," or load the file from the template app with "Load and check from template app" (the selected file is read only within your browser and is not sent anywhere).
  2. A table is displayed listing: sheet name!cell reference, the merge tag written there, its mapped destination, and status (✓ / ⚠ Not Found).
  3. Any item showing "⚠ Not Found" means the tag name on the Excel side doesn't match the mapping on the configuration screen.

Opening "Field Codes for This App (for copying)" at the bottom of the screen shows a list of this app's field codes; clicking one copies it in the form {field code}. You can then paste it into your Excel template.

9. Setting 3: Output

Configuration screen: output settings

10. Additional settings for Label mode (label quantity settings)

When "Label" is selected as the output mode, "Label Quantity Settings" appears below "1. What do you want to create?"

If you want to generate multiple labels from a single record, turn on "Generate multiple labels based on quantity" and configure the following.

Setting Description Default
Total quantity field Field containing the total quantity (numeric portions are read correctly even from a string like "Plan: 100") (Required)
Quantity per label field Field containing the quantity per label (Required)
Label quantity tag name Tag name used in Excel as {labelQty} or {{labelQty}} labelQty

Examples:

11. Advanced settings (usually no need to change)

"Advanced Settings" at the bottom of the configuration screen are intended for engineers. If you're using the new {field code} notation, you generally don't need to touch these.

11-1. {{tag}} mapping table

Configure this only if you're using double-curly-brace tags like {{partNumber}} on the Excel side. Under "Add Merge Item," map each tag name in Excel to the type of value to merge (kintone field / auto-generated value / fixed text) and its selected content.

QR image: Turn on "Output QR image," merge the cell range where you want to place the QR code, and enter {{QR:tag}} (double curly braces) in the top-left cell. At output time, the QR code is automatically placed within that merged cell range. "QR margin (px)" can usually be left at 4. "QR position" (left/center/right; unset = center) lets you choose the QR code's horizontal position within a wide merged range (it's always centered vertically). For a barcode, use {{BC:tag}}.

In Document mode, writing {{QR:Table.Field}} (e.g., {{QR:LineItems.PartNumber}}; for barcodes, {{BC:...}}) in a merged cell within a line item row generates a QR code for that row's value, row by row. Make sure any merged cell holding a QR code stays within the bounds of the line item row (a merge spanning multiple rows is still repeated along with the line item block it belongs to).

Available auto-generated values (some only receive a value in specific contexts, such as label generation or page splitting):

Value Description
recordId Record number
seqNo Label number / page number
seqTotal Total number of labels / pages
pageNo Page number
pageTotal Total page count
detailStartNo / detailEndNo Line item start/end number
detailNo Line item row number (within the page)
labelQty Quantity for this label
splitIndex / splitKey Split number / split key
ticketId Ticket ID
qrText / ticketQr / partQr QR code text (by purpose)
today / now Today's date / current date and time

11-2. Line item column mapping table

Used only when the template has no row containing {Table.Field} (ignored if you're using the new notation). Configure the line item table (subtable), the line item start row (the row number where line items begin in Excel), line items per page (legacy), display of blank rows (whether to hide empty rows on pages with fewer line items), and the line item column settings (mapping between Excel columns and subtable fields).

11-3. Print layout correction

Only if the width or height is off after Excel output, adjust the width correction and height correction (default 100%).

12. Saving and updating the app

  1. Click "Save" at the bottom of the configuration screen.
  2. After saving, a message appears: "To apply these settings, please click 'Update App' in the upper right."
  3. Return to the app's settings screen and run "Update App."

Saving alone does not apply the changes to the production screen, so be sure to also update the app.

13. Using it from the view screen

View screen button

  1. Open the view screen of the target app. If you haven't restricted which views show the button in the settings, the button appears on all views.
  2. Click the button at the top of the screen (default label is "Generate Labels" for Label mode, "Output Documents" for Document mode; if you've renamed it in settings, that name is used instead).

Generate modal

  1. The "Select Records to Output to Excel" dialog opens. It lists the records currently shown in the view; check the ones you want to output ("Select All" and "Clear" are also available). If your current filter spans multiple pages, use "Load All Filtered Records" to reload all matching records (up to the max sheet count) keeping the same filter conditions and sort order. In Document mode, all the selected records (e.g., all work orders filtered by job number) are combined into a single workbook (default: stacked on one sheet, with page breaks between records).
  2. Click "Generate xlsx" to download the xlsx file with the selected records merged in. Click "Close" to cancel.
  3. If you've configured print status updates, the status (and related fields) of the output records is updated automatically.

14. Common troubleshooting checks

Symptom What to check
Button doesn't appear in the view Whether the plug-in settings have been saved and the app updated. Whether that view was excluded in "Views to show the button on." Whether the feature is stopped due to an unregistered or expired license (check the notice in the lower-right corner)
"Excel template not found" / "Failed to retrieve" appears Check the Template App ID, Template Code to Use, Status Field Code and Active Status Value, and Template Attachment Field Code (confirm that the matching code's row in the template app is set to ACTIVE)
Merge doesn't happen (tags remain as plain text) Load the template in "8. Verify the mapping between the template and fields" and check for "⚠ Not Found." Confirm the tag name in Excel matches the mapping on the configuration side (field code/mapping)
QR code/barcode doesn't appear (for line item rows, check the spelling of {{QR:Table.Field}} and that the row's value isn't blank) Confirm you wrote it as {{QR:tag}} (barcode: {{BC:tag}}) with double curly braces (single braces {QR:tag} are not supported). Confirm the QR image setting is turned on. Confirm the tag has a value. Confirm the cell range is merged
Can't generate multiple labels Confirm both "Total quantity field" and "Quantity per label field" are selected. Confirm the values can be read as numbers
"Number of selected records exceeds the max sheet count (max record count)" appears Review the max sheet count setting (default 100), or reduce the number of selected records
"This browser cannot open the template xlsx" appears Reopen using the latest version of Chrome or Edge on a PC (kintone mobile is not supported)
"Failed to generate xlsx" appears Check the template file format (.xlsx) and the tag notation
xlsx is output but print status isn't updated Check the print status field, the value being set, and your edit permission for that field
A "stopped" notice appears in the lower-right corner The license key is unregistered or expired. Register the key (or start a trial) on the plug-in configuration screen, then save and update the app

Running kintone on your own?

PlugBits Launcher — jump to settings and copy field codes, all from the Ctrl+/ command palette. Just add it to your browser.