XL Docs keeps its configuration in two Quickbase tables that the installation wizard adds to your app: Document Templates and Document Subtable Excel. This article describes every field in the Document Templates table. Each Document Templates record is one template: the Excel file to fill, the map of master-record fields to cells, and the settings that control which sheet and which PDF pages are used.
The related table, Document Subtable Excel, holds the data tables (lists of related records) that go into a template. It's described in Document Subtable Excel table reference.
Note
We recommend the XL Docs Configurator for creating and maintaining records in both configuration tables. It writes these fields for you with a point-and-click interface. See Configure a template. This reference is useful when you want to read, check, or edit a configuration by hand. For a step-by-step walkthrough of building a template, see Build a document template.
Note
If you also use Exact Forms Plus, the Document Templates table might already exist in your app, because both extensions use it. Exact Forms Plus stores Word templates in it; XL Docs stores Excel templates.
Fields
XL Docs and the XL Docs Configurator find these fields by their labels, so keep the labels exactly as the installation wizard created them. The Configurator label is given where the Configurator shows the field under a different name. Several fields hold field IDs and table IDs. To look them up, see Find your Client ID, table IDs, and field IDs.
Field | Type | Description | Example |
|---|---|---|---|
Name | Text (required) | The name of the template, for example the kind of document it produces. The field help reads Enter a Name for this Document Template. Configurator label: Template Name (Fields tab, Template Settings section). The Configurator won't save without it and shows the error Name is required. |
|
Excel Template File | File attachment | The Excel workbook that XL Docs fills in. It must be saved as The workbook can contain static text, logos, images, formatting, formulas, charts, and pivot tables. XL Docs writes values into the cells you map and leaves the rest of the workbook as it is. By default, the generated document has the same file type as this template. A record with no file attached fails with The template record exists but there is no file associated to it. Please make sure that a template file is attached to the template record. On some installs the installation wizard labels this field Template File. It's the same field. Not shown in the Configurator. Upload the file on the Quickbase record. |
|
clist | Text | The column list: which master-record fields go into which cells. The master record is the record the XL Docs button runs on. Format: one entry per cell, entries separated by a period (
To send one field to two cells, add two entries, for example Leave the clist empty if all of the template's data comes from data tables. Configurator label: the Field Mapping grid on the Fields tab (Cell Position and Type columns) and the Images tab (Width (px or Auto), Height (px or Auto)). | |
Excel Sheet # | Numeric | The sheet (tab) of the workbook where the clist values are written. The number is positional: Not required: a workbook that only needs rows from data tables doesn't use it. Each data table has its own Sheet setting. Configurator label: Excel Sheet # (Fields tab, Template Settings; whole numbers from 1). |
|
PDF Pages | Text | Which sheets of the generated workbook go into the PDF. Used only when the button creates a PDF ( Valid values:
Sheets are numbered left to right, starting at 1. XL Docs sorts the numbers and drops duplicates. If you list more sheets than the workbook has, generation stops with Something's wrong with the pages you selected. You entered more than the sheets you have in your template. The field help reads: You need to specify the pages you want to be included in the PDF Document. You can use few of these formats, with the examples Configurator label: PDF Pages (Fields tab, Template Settings; placeholder e.g. 1,3-5). |
|
Master table name | Text | The name of the master table: the table the clist fields come from, and where the XL Docs button lives. Free-form text, for your reference. The Configurator fills it in from the table you choose. The table XL Docs actually reads at generation time is the one passed in the button's Configurator label: the text of the Table dropdown (Fields tab, Master Table Selection). |
|
Master table dbid | Text | The table ID (DBID) of the master table. The Configurator uses it to list the master table's fields in the Field Mapping grid and to resolve "(parent)" field comparisons in data-table queries. Configurator label: the value of the Table dropdown (Fields tab, Master Table Selection). The tooltip reads: Select the master/parent table to grab data from. You must select a table, but you do not have to fill in fields below if you intend to only use subtables. | The DBID shown in the table's URL, for example |
Document Subtable Excel DBID | Formula - Text (required) | Holds the table ID of the Document Subtable Excel table, so XL Docs can find this template's data tables. The installation wizard creates it as a formula that returns the table's alias. Don't change or remove it. If the field is missing or blank, generation stops with The template record was found, however the 'Document Subtable Excel DBID' field was missing or blank. Please make sure that the field exists and is set to the DBID of the 'Document Subtable Excel' table. Not shown in the Configurator. | |
MSG_DetailsNotFound | Text | Optional message for this template. The field help reads: This message appears in the generated document when no records are found for the subtable data. Not shown in the Configurator. |
|
Exact Forms Plus Version | Text | Created by the installation wizard because the Document Templates table is shared with Exact Forms Plus. XL Docs doesn't use it; leave it blank for XL Docs templates. | (blank) |
Formula - Text with "Allow some HTML tags" (button) | The button that opens the XL Docs Configurator for this template. It appears after the record is saved. See Configurator overview and installation. | Button labeled XL Docs Configurator | |
Add New XL Document Subtable | Formula - URL (button) | A standard Quickbase add-record button that opens a new Document Subtable Excel record already related to this template. Use it if you add data tables by hand instead of with the Configurator. | Button labeled Add New XL Document Subtable |
Add records to the configuration tables
This section explains how to set up a template by entering values directly in the configuration tables. It's a good primer on how the tables fit together, but the XL Docs Configurator does all of this for you and is the easier way (see Configure a template and Configure a data table).
Create the template file
Create an Excel workbook that looks the way your finished document should look, and save it as .xls, .xlsx, or .xlsm. You can include static text, logos, and images. Placeholder text such as [Name] or [Company Name] can help you lay it out, but it isn't required: the clist decides what data goes where, and mapped cells are overwritten.
For example, an invoice template might have a logo area, the company's address block, INVOICE NO., DATE, and CUSTOMER ID cells, TO and SHIP TO blocks with placeholders such as [Name], [Company Name], [Street Address], [City, ST ZIP Code], and [Phone], a line-item table with DESCRIPTION, QUANTITY, AMOUNT, and TOTAL columns, a TOTAL DUE cell, and a closing line.
Create a Document Templates record
You'll need the field IDs of the master-table fields and the master table's ID. See Find your Client ID, table IDs, and field IDs.
Go to the Document Templates table in your app.
Add a new record.
In Name, enter a name for the template.
In clist, enter the cell map for the master-record fields (see clist).
In Excel Template File, select Choose File and upload the workbook from your computer.
In Master table dbid, enter the table ID of the master table (the table the clist values come from).
In Master table name, enter the name of that table.
In Excel Sheet #, enter the number of the sheet the clist values go on.
If you'll create PDFs, optionally enter PDF Pages, for example
1-5,8,10-12.Save the record.
Add a Document Subtable Excel record (optional)
To include data from other tables, such as an invoice's line items, add a Document Subtable Excel record from the template record (for example with the Add New XL Document Subtable button). Each record is one query of data to embed in the workbook. A record doesn't need its own sheet: you can place several queries on one sheet.
Enter a Description.
In dbid, enter the table ID of the table the data comes from.
Enter the clist for where the rows start.
To sort, enter the field IDs to sort by in slist. Use slist Options for sort direction, or to skip records or limit how many are returned.
Enter the qry that decides which records are included.
To subtotal columns, enter them in stlist.
If the records should run down the sheet one row per record, check Is Data Grid?.
In Sheet, enter the sheet the data goes on.
To group the rows (one level of grouping), enter the label column and the field ID to group by in grouplist.
If the template has a fixed area that holds only a certain number of rows, enter that number in Max Line items, and in Max Lines type choose what happens when there are more records: Insert New Rows on the same sheet, or Insert New Tab to continue on a copy of the sheet.
Save the record.
Every field is described in Document Subtable Excel table reference.
Which records do I need?
Scenario 1: data on one sheet. For a workbook with one sheet where data goes into individual cells, create one Document Templates record and define its clist. No Document Subtable Excel records are needed.
Scenario 2: data on more than one sheet, no lists of records. Create one Document Templates record for the cells on its Excel Sheet #, plus one Document Subtable Excel record for each other sheet that needs data in individual cells. For example, if sheet 1 needs data in A1, D2, and E10, define those on the template record; if sheet 2 also needs data, add a Document Subtable Excel record with Sheet = 2.
Scenario 3: data on one sheet plus a list of related records. Create one Document Templates record and one Document Subtable Excel record. In the template's clist, map the cells you need and add a variable for the related key at the end, usually the Record ID#, for example RK:3. In the Document Subtable Excel record, use that variable in the qry to find the related records, for example {'13'.EX.'[RK]'}, and set the clist to the row where the list starts. If more sheets need related lists, use the same variable in their queries.
For example, an invoice template with this clist:
B2-I:63.B12:53.B13:17.B14:49.B15:54.B16:18.E12:53.E13:17.E14:49.E15:54.E16:18.B19:7.E6:26.E7-D:6.E8:48.RK:3has a Document Subtable Excel record named Order Line Items with clist B22:19.C22-N:6.D22-N:7.E22-I:21, qry {'13'.EX.'[RK]'}, Is Data Grid? checked, and Sheet 1. The line items are the records whose field 13 (the related order) equals the invoice's Record ID#, listed from row 22 down.
Scenario 4: several sheets, each with a list of records. Create one Document Templates record with an empty clist (just the template file) and one Document Subtable Excel record per sheet. For example, a three-sheet workbook of customers, orders, and line items:
Description | clist | slist | qry | stlist / grouplist | Is Data Grid? | Sheet |
|---|---|---|---|---|---|---|
Customers dump |
|
|
| stlist | Checked | 1 |
Orders |
|
|
| stlist | Checked | 2 |
Line Items |
|
|
| (none) | Checked | 3 |
The query {'3'.GT.'0'} (Record ID# greater than 0) returns every record in the table.