Excel, like other spreadsheet programs, allow you to assign a name to an individual cell, or a range of cells. This naming facility allows you to "tell" NV2 how you want the resulting table or document to look.
When you create a document template, you assign names to cells in the spreadsheet where you wish to place information. For example, to have the page number printed in cell A1 you would assign the name "PAGE" to cell A1.
When you print using the template, NV2 opens the template file, builds a list of the names and cell addresses you have setup, creates a new spreadsheet, and then uses the list of names and addresses to place information in the new spreadsheet.
All other aspects of the template are copied over as well. For example, margin settings, fonts, images, etc.
The names you assign to cells depend on the type of document template you are creating or editing. For example, the name "TEXTAMOUNT" can be used on a check template to print the amount of the check in words, however "TEXTAMOUNT" has no meaning on an invoice or statement. Therefore there are different lists of names allowed on different types of documents.
Non-repeating names (with some exceptions) usually appear only once on a document.
Examples would be a customer address on an invoice, the statement date, etc.
For convenience, we refer to these names as Header names.
Names that represent repeating information are things like the details on a check stub, the line items on an invoice etc.
For convenience, we refer to these names as Item names.
It is often necessary to place the same information, in two or more places on a template. A good example is a customer statement that has a tear-off portion on the right where items like the invoice date and reference number are repeated twice on the same line. A simple example is the need to print the check date or number on the check, and on the check stub(s).
To use a name more than once, you simply name the other cells using the name followed by an underline and a number.
For example:
INVOICEDATE and INVOICEDATE_2
During printing, the date of the invoice will be printed in both named cells.
Excel itself has several rules governing range names. For example, you cannot use the name "ABC+123" because the name contains a plus character - which would be confusing if the cell name was referenced in a formula.
The naming convention used by NV2 adds a few more rules - mostly to differentiate between Header and Item names.
Header names:
Cannot begin with ITEM_
May end with an underscore and suffix if the data needs to be placed on the template more than once.
Repeating data refers to items like the items listed on an invoice, or the details of a distribution. This type of data is called item information.
Item names:
Begin with ITEM_ and end with a pre-defined name (e.g. ITEM_QUANTITY is used to print the invoice item quantity for each invoice item).
The name ITEM_AREA is reserved for the cell range that contains the item (repeating) data.
Item names must end with the same underscore and suffix as the item area they are printed in. For example, if a perforated customer statement prints the same items on the left and right side of the statement, two item areas (cell ranges) need to be defined. If the item area on the left is called ITEM_AREA_1 and the item area on the right is called ITEM_AREA_2, the item names on the left must all begin with ITEM_ and end with _1. The item names on the right must all begin with ITEM_ and end with _2.
Header and Item Ranges
Named ranges for headers and items can only be one cell wide. If the template layout permits, you can widen the column to accommodate larger fields (e.g. invoice item descriptions). In cases where widening a column will distort the template layout, you can merge horizontally adjacent cells to create a larger cell. To merge a range of cells in Excel, select the range and use the command Format>Cells>Alignment>Merge Cells.
Named ranges for headers can be as many rows as required in height.
Named ranges for items can only be one row in height.
Item Areas
Item areas are things like the body of an invoice where items sold are listed line by line, or a paycheck stub where the various earnings and deductions are listed.
A template can contain as many item areas as required (including none).
Item areas must have a range name associated with them.
Item area range names must be ITEM_AREA followed by an optional underscore and suffix.
All item names in an item area must be placed on the first row in the item area.
NV2 needs to know where the document starts and ends on the Excel template, therefore a print area must be defined.
The print area must start at row 1.
The print area is copied to produce multiple pages as needed.
The copies are vertically contiguous, with page breaks between them.
Anything in the spreadsheet outside the defined print area is ignored.
This is an example of a check template with two item areas (stubs). The text in upper case letters corresponds to range names that have been defined in the spreadsheet.