Form Design: Using Repeat Tags
| See this article about recommended version of Open Office and Libre Office for creation and Editing of templates Recommended Office Versions |
When designing forms, you’ll often encounter repeating data. Repeating data can be found in the Example form shown earlier in this document. A discussion of the use of tabs and rulers to model repeating data can be found earlier in this document.
Repeat Tags
Repeat tags allow you to declare that a section of your OpenOffice document should repeat based on the number of rows of repeating data. An obvious application of this feature is to create a table row that is declared to repeat for as many rows of transaction data that are sent from the host.
Using tables instead of tabs and rulers to model repeating data gives a great deal of control and flexibility to the forms designer. We have designed our repeat tags with the goal of allowing the programmer on the MultiValue host to be able to send data to a template without concern about how it will be formatted. Our goal is to embed all formatting rules and directives into the document template and have none of the rules in the MultiValue server applications.
By keeping data separated from presentation, programmers can freely send data to the Blue Prairie Forms engine without concern about how that data will be formatted, paginated or styled. The forms designer, using standard OpenOffice, can embed elements into the form template to control the presentation and styling of the data.
Syntax of a repeat tag
{repeat=<element>;block=<blockname>;increment=<number>;finalincrement=<number>}
Example
{repeat=tr;block=det;increment=12;finalincrement=6}
Example within a OpenOffice Table Row
|
Qty |
UOM |
Shipped |
Line |
Part Number |
Desc |
Amount |
|
{repeat=tr;block=det;increment=12}%d.qty%
|
%d.uom%
|
%d.qtyShipped%
|
%d.line%
|
%d.partNo% %d.partNo2%
|
%d.desc% %d.desc2%
|
%d.amt%
|
The data being sent from the application for each %tag% in each cell, is as associated multivalue array. The application generating the mutlivalue arrays declared that the group together would be called ‘det’ (for detail). You’ll see this name in the block= directive in the first data column of the above table.
Breaking down the example in the first column
Note: elements are separated by semicolon (;)
|
Element |
Purpose/Function |
|
repeat= |
Tells Blue Prairie Forms the odt document element to repeat. In the example above, the value tr is assigned. The value tr means ‘table row’. When tr is specified Blue Prairie Forms will duplicate (repeat) everything from the table row start tag that precedes the {} declaration to the table row ending tag that follows the {} declaration. The number of rows created is equal to the number of mulivalues in the first tag associated with the block ‘det’ unless the number of repeats is overridden using the optional ‘increment’ parameter described below. Supported Repeat Values: repeat=tr Repeat table row repeat=tc Repeat table cell repeat=table Repeat table (added in version 180203) |
|
block= |
Tells Blue Prairie Forms the block that will be associated with this repeat. A block is a name given to a collection of tags to declared them associated together. In the example above, each of the tags found in the table row to be repeated have been declared to be part of the ‘det’ (detail) block. When using the Blue Prairie Forms API, you’ll pass a tag name and a value associated with that tag. You’ll also pass the block-name you wish to have associated with the tag and its value (see bpi.form.tagval2() subroutine in the API. |
|
increment= |
This parameter is optional but if used, must be numeric. Without it, Blue Prairie Forms will repeat the repeated odt document element for precisely the number of multivalues counted in the first tag/value of the declared block. If increment is specified and it is a number greater than 1, then the number rows generated will be the next higher multiple of increment greater than the actual number of multivalues in the first tag of the block. For example, if you always want 12 rows on every page of your table, then set increment to 12. If 20 the first tag/val set in the block hold 20 multivalues, then 24 rows (the last 4 being blank) will be generated. If 42 multivalues and increment is 12, then 48 rows will be generated with the last 6 being blank. This capability allows you to create forms with a fixed number of table rows (a grid) that will be consistent across all pages of the document including the last page. Without this, the last page would contain only the number of rows required to finish the actual data rows leaving non-grid white space below the table (this is the default behavior). |
|
finalincrement |
Because OpenOffice/LibreOffice lacks the ability to easily product a different footer for the first or last page of the document, you will sometimes want to place your document totals (for example) below the detail table at the bottom of the page. If you don't use increment, then the position of the total section may be higher or lower on the document based on the number of repeat rows. The problem with increment is that it will allow you to force the number of displayed detail rows in your table but it does not allow room for the total rows below the grid. The finalincrement parameter performs a calculation and reduces the number of detail rows at the end of the table to allow for the total rows and other information you may wish to place below the table. Some day, OpenOffice/LibreOffice may allow for firstpage header and last page header styles or may allow for hidden sections that can reference the current page number to calculated whether a footer should be hidden on all but the last page. But until then, finalincrement is your friend. Note: The process of using finalincrement involves: 1) Counting the number of table rows that can fit on a single page other than the last page (increment) 2) Counting the number of table rows that can fit on the last page (final increment). 3) Altering the repeat tag used in the table to match the increment and final increment. If you find that despite your best efforts to count accurately, that data below the last data row line (your pseudo footer) is not in the correct place (at the bottom of the last page), then the issue is most likely: 1) That your final increment value is not correct 2) That the row height you have specified for your repeating data row is 'just a little bit off'. Try making it slightly taller and try again. We have seen that on occasion, certain row heights, across many repeat rows may 'creep' and cause BP Form calculations for the padding of the data grid extra rows to be off. By making a slight adjustment to the height of the row that is being repeated, the problem will usually clear. |
Cautions
When using repeat tags. you are given a lot of power, but that comes with responsibility. Since repeat tags iterate through data sets, you must be careful not to nest repeat tags. I other words, you should be careful to have only one repeat tag per element. If you find yourself in a situation where BP forms seems to get stuck in a loop, this is likely the reason. In that event, use the find tool in Libre Office to locate the string 'repeat' and verify that you do not have recursive or nested repeat tags within an element.
If you are having difficult seeing the point of recursion, you can up the verbosity of your print program and pass the verbosity parameter at a value of 5 or more. This will show you the generation steps being performed and may help you see where you have inserted nested repeat tags.
Form Design: Using Barcodes
| See this article about recommended version of Open Office and Libre Office for creation and Editing of templates Recommended Office Versions |
Important Note:
To use barcodes, you must install the same barcode font on your form design workstation (your PC) and the Blue Prairie Forms Server(s). If you do not install the barcode font on the Blue Prairie Forms Server(s) then the barcode may appear when you are designing the form but will only show the value of the barcoded tag when rendering the form via the Blue Prairie Form(s) servers.
Acquire a Barcode Font
You may search the internet for the type of barcode font you wish to download. These should be delivered to you as a .ttf (true type font) file. These files can be used on either Linux or Windows. Be careful when downloading things from the internet to ensure that you don't inadvertently install adware/malware. Many companies attempt to lure you into using an installer package to install their font. While there is nothing fundamentally wrong with this, you should always keep a watchful eye out for installers that install more than just the font you desire. Blue Prairie makes no warranties or assurances about the cleanliness of the links below, please proceed with caution. The author prefers sites that simply allow the download the .ttf file or a series of .ttf files in a zip archive.
Barcodes Inc: https://www.barcodesinc.com/free-barcode-font/
Inflow Blog: https://www.inflowinventory.com/blog/free-barcode-font-code-39-3-of-9/
Free-barcode-font: http://www.free-barcode-font.com/
ID Automation: http://www.idautomation.com/free-barcode-products/code39-font/
Installing Barcode Fonts on your Windows System (most Windows Versions)
- Upload the acquired .ttf file to a directory visible to your Windows PC.
- Select Start, then Settings and click on the Control Panel.
- Select Fonts, then File in the main tool bar, and click on Install New Font.
- Select the folder where the .ttf file was downloaded.
- Select the desired font and click on OK.
- Open an app to see if the Font is now visible. If not, proceed with the next two steps
- Select Start and choose to shut down and restart the computer.
- The font should be active when the computer is restarted.
Installing Barcode Fonts on your Linux System
BP Forms produces a variety of barcodes using the native capabilities of OpenOffice/Libre Office. These products produce most barcodes by the use of specialized barcode fonts. These fonts are not installed with OpenOffice/LibreOffice by default so you must download and install them both on the PC where you intend to perform your form design with OpenOffice/LibreOffice and on the Linux Open Office/Libre Office server that will be rendering your forms (aka: The linux print server). To use specialized fonts such as barcode fonts, you must legally obtain the desired true type or open type font (.ttf) then upload the font to the Linux/OpenOffice server. The installation is straight-forward as defined below:
Prepare a directory
- Login to your Linux/OpenOffice server using ssh.
- cd to /usr/share/fonts
- See if there already exists a directory called truetype
- If not: mkdir truetype
- chmod 755 truetype
Upload the .ttf file to this directory
- Using a a file transfer tool such as ftp, upload the .ttf file to /usr/share/fonts/truetype
Check the permissions
- Using your ssh session, cd to the truetype directory and chmod 644 *
- cd /usr/share/fonts/truetype
Generate the index files
- ttmkfdir > fonts.scale
- mkfontdir
Verify that the index files were generated
- ls -la
You should now see a listing somewhat like this (this example based on IDAutomation's Barcode Font, your font name may differ):
[root@PT-Dev fonts]# cd truetype[root@PT-Dev truetype]# ls -latotal 60drwxr-xr-x 2 root root 4096 Jun 20 18:04 .drwxr-xr-x 31 root root 4096 Jun 20 17:46 ..-rw-r--r-- 1 root root 171 Jun 20 18:04 fonts.dir-rw-r--r-- 1 root root 171 Jun 20 18:04 fonts.scale-rw-r--r-- 1 root root 41732 Jun 20 17:57 IDAutomationHC39M.ttf[root@PT-Dev truetype]#
Note the size of the fonts.dir and fonts.scale files. These contain a directory listing describing the fonts found in this directory. This is what OpenOffice reads when populating the ‘font’ pull-down within the product and/or to reference a font specified within a document.
You should now be able to call up OpenOffice on the console or via a remote desktop connection and create a new Writer document. Then choose the font pull-down to confirm that your font is indeed visible to OpenOffice
Using the Barcode Font in a Template
Using most types of barcodes is simple in BP Forms. A type of barcode known as "3 of 9" is generally used for most forms-based barcode work. Open Office and Libre Office have add-on font packs available to render document elements as barcodes rather than text. The process of creating a barcode is as simple as:
- Ensure that you have the barcode font installed on your templating editing PC and on your BP Forms open office server (the server that renders the documents).
- Edit the template
- Select a field that you wish to barcode
- Choose font > (barcode font) (example: font>IDAutomationHC39M)
- Adjust the font size and letting to suit
- Save the document template
- Voila, you have barcodes
That's really it. No programming is required. Just select a tag field and choose the barcode font.
Example
Assume we have the following document template. Notice the placeholder tag %invoiceNo% which is selected in the template below:
Making it a Barcode
- Select the tag (see that we have selected %invoiceNo% in the example above).
- Choose Font>IDAutomationHC39M from the menu
- Set the size to suit
Notice in the image below that the tag %invoiceNo% has changed to a barcode and that below the barcode, you can still see the placeholder tag name %invoiceNo%
Because the placeholder tag name is still intact within the document template, it can still serve as a placeholder just like any other placeholder tag. When the template is used to render a document, this placeholder's value will be changed from %invoiceNo% to the actual invoice number. At that time, the barcode will automatically change to represent the invoice number. In this way, you may barcode anything in the form by simply choosing the desired barcode font within the template and applying it to any placeholder tag.
Advisories About Scanning
The barcode font may be scanned using any scanner that recognizes the barcode type (in the example above, this is a 3 of 9 barcode). However, some scanners man be finicky about the size of the barcode and the letting (spacing between the lines of the barcode). It is recommended to print a test sheet of barcodes using sample values and then test these barcodes with your scanner to ensure that it can easily read the barcode. You may determine that there is a minimum size or letting that is required in order to help the scanner more easily read the barcode.
Things to Adjust To Help Your Scanner
Emphasis
To render the most clear barcode, remove all special emphasis properties from the barcoded placeholder tag. These include removal of Bold, Italic, Underscore, etc. from the placeholder tag.
Size
You can adjust the size of the font upward or downward to achieve the best compromise between fitting on the page and making it easy for the scanner to read the barcode
*Encase with Asterisks*
Some scanners prefer for a barcode to start and end with the asterisk character. Consult your scanner documentation to determine if this is true of your specific scanner model. To encase the bacode with asterisks simply edit the template and change the placeholder tag to begin and end with asterisk. For example, instead of using %invoiceNo%, change it to *%invoiceNo%*.
Adjust Letting
Letting is the spacing between characters (the vertical lines) in the barcode. This can be achieved in OpenOffice / LibreOffice by selecting the placeholder then choosing Format>Character from the menu. The following page will be shown:
Choose the "Position" tab and then adjust the Spacing characteristic. As you adjust the spacing, you will see the resulting effect in the preview window presented in the page. You may need to experiment with a few settings until you observe an improvement in the scanner's ability to read the barcode.
Form Design: How to Use Placeholder Tags
| See this article about recommended version of Open Office and Libre Office for creation and Editing of templates Recommended Office Versions |
Blue Prairie Forms uses normal OpenOffice (or Libre Office) documents as a template to create final documents. Template files are normal OpenOffice documents in most respects but they also contain specialized text snippets called placeholders (aka “tags”). Placeholders are generally unique words, often prefixed with odd characters to make them unique within the document. These placeholders are used to mark locations within a document where real-time data from a transaction should be placed. We call these placeholders ‘tags’.
It is important to understand the terms TAG and VALUE. Tags are simply short names that are associated with dynamic text. If you are familiar with the operation of mail merge functions within word processing products, you already understand tags.
Placeholder / Tagging Practices
Using mail merge as an example, you might write a word processing template that looks like this:
Sample Template File
Dear ~customer,
Thank you for your purchase of ~product on ~date.
We look forward to serving you in the future.
Sincerely,
John Galt
President
Sample Transaction Data
The template contains the following tags ~customer. ~product and ~date. In mail merge, these words are generally column names from a spreadsheet or database.
An example might look like this:
|
customer |
product |
date |
|
Dagny Taggart |
Rails |
04/10/16 |
|
Jim Taggart |
Toy Trains |
04/10/16 |
|
Wesley Mouch |
Lobotomy |
04/10/10 |
A Sample Finished document
Dear Wesley Mouch,
Thank you for your purchase of Lobotomy on 04/10/10.
We look forward to serving you in the future.
Sincerely,
John Galt
President
When the mail merge is started, the program iterates through the rows in the above table. It will produce three documents and the last document will look like the Sample Finished Document above.
Be Unique
Tags can be any text you wish but care should be taken to ensure that they will not inadvertently clash with words that will be used as static elements of your template. For example, if you use 'customer' as a tag and then create a template that includes the paragraph
“We will be offering 10% to all of our customers”
then when you generate the final document, the paragraph would be changed to:
“We will be offering 10% to all of our Wesley Mouchs”
In order to avoid situations where normal static text is inadvertently replaced by a tag value, it is a good idea to use a tag naming convention that prevents these types of collisions. For example, if you use use the tag “%customer%, instead of “customer', you'll be in good shape because the chance of %customer% occurring in casual text is very remote.
I believe it is also a good practice to always end the tag with a special character. This prevents possible collisions between ambiguous tags. Consider what would happen if we used the following tag names.
|
Tag Name |
Value |
|
%customer |
Taggart Transcontinental |
|
%customer_address |
123 Taggart Avenue |
If we then created a template that looked like this:
Dear %customer,
We see your address is %customer_address.
And then we rendered the template to a final document, we would end up with:
Dear Taggart Transcontinental,
We see your address is Taggart Transcontinental_address.
This is because the rendering engine will first go to the first tag in the table above and replace all instances of %customer with Taggart Transcontinental. This causes the second tag “%customer_address” to be altered in the final document. The second tag becomes “Taggart Transcontinental_address”. So then when the rendering engine processes the second tag, it looks for %customer_address in the template and does not find it because it has already be changed.
Using the above example, consider what would happen if you simply ended the tag name with a % sign. This would prevent the ambiguity and would cause the document to be rendered as expected.
Percent (%) is a character that is often used in UNIX scripts and the author has adopted it to use when naming his tags. However, anything that allows the tag to be unique and non-ambiguous can be used. Blue Prairie Forms does not place restrictions on the characters use in a tag (below Hex FC). However, we highly recommend that you only use tags that:
Tag characters to avoid
- Do not include control characters
- Are 7-bit (lower than ascii 128)
- Do not include unix demon characters
- Do not include lf, cr or tab (see rule 1 above)
OpenOffice Template Design Considerations
Microsoft Word
Most users are familiar with Microsoft Word. The techniques used in Word and OpenOffice are similar enough to allow you to become productive in Open Office quickly but different enough that it can be a little frustrating when you first start using Open Office. The frustration comes from being within a document editor that feels very much like Word but then experiencing differences in terminology, menu layout, etc. that make it necessary to ‘think’ when in Microsoft Word these actions are automatic.
Warning: The tag within the template contains formatting markup
You may find that your tag name appears in your template and that you are certain that you have assigned it a value in your host program and let it still the tag remains in the final document rather than being replace with its assigned value. This can happen if you have inadvertently injected market into the tag.
Example:
%myTagName%
In this example, you'll observe that the letters %my are in red while the TagName% ending is in black. For the system to be able to understand that the first part is red and the last part is black, it must place special markup within the string %myTagName% when it stores the tag within the document.
To explain, it might internally store the above with markup like this:
<setColor=red>%my<setColor=black>TagName%
So then, the tag %myTagName% does not really exist because the markup being used has changed the tag name to something other than what is visible in the template. Without the tag name being one coherent, unbroken piece of text, the routine while replaces tags with values would be prevented from finding the tag and replacing it with the proper value.
To remedy
To remedy this situation, you may edit the template and verify that the tag contains no hidden markup by following this procedure:
- Triple click to select the entire tag
- From the Open Office / Libre Office menumenu, choose Format > Clear Direct Formatting
- Now, triple click to select the entiire tag
- With the entire tag selected, you may apply justification, color, font, font-size etc. to the entire tag
By Applying the formatting to the entiire tag, rather than to a part of the tag, you will ensure that the entire tag string is preserved as one, coherent, unbroken text string and this should allow the tag to function as expected.
Caveat Emptor
It can be tempting to initially design templates for Blue Prairie Forms using Word rather than Open Office. Indeed, it will save time initially but you will find that incompatibilities between the two products may lead to wasted time and/or odd behavior especially for more advanced forms that use features such as auto page numbering, section breaks, etc.
It is worth the effort spend a few moments to familiarize yourself with Open Office and to refrain from using Word to edit Blue Prairie Forms odt templates.
Open Office Primer
A few minutes spent reviewing the sections below will give you a good understanding of how to properly construct an Open Office odt template from scratch and to avoid frustration when transitioning your form creation skills from Microsoft Word.
Powerful and Flexible but Technical
Open Office is said to be more powerful and flexible than Microsoft Word. It is also said to be more oriented towards the technical mind. Microsoft Word attempts to cater to the non-technical user allowing a more intuitive way to dealing with document elements such as footers, headers, breaks, and styles. All of this is true but with a little time invested by reading this section of the document, the transition to Open Office’s way is an achievable goal for even non-programmers.
A Word about Style
If you are familiar with the use of styles and have incorporated them into your document creation practices in Word, then you will find this transition easier than for those who have not used styles previously.
What is a style?
A style is simply a collection of ‘settings’ that are given a name. This provides a handy way to ascribing certain settings to paragraphs, pages, characters and other elements within a document without having to manual change options for each element separated.
For example, you could create a paragraph style called “quote” that sets the font, font size, font emphases, color, space between lines and even ruler settings. Now, when writing a document, instead of having to make all these adjustments each paragraph that is a quote, you can instead simply select the paragraph then apply the “quote” style to it.
Page Style
As a Blue Prairie Forms template designer, you’ll often face the challenge of converting an existing multi-part form to a laser form. Part of the function of a multi-part impact form is that each layer of the multi-part form denotes a specific flow within the business process. For example it’s common in multipart forms to have three copies; top/white is “Customer Copy”, middle/pink is “Office Copy”, bottom/blue is “billing copy”. Over time, business work flows are developed whereby workers understand to hand the white copy to the customer then burst and separate the office and billing copies based on color and enter them into the appropriate ‘flow’ within the company for processing and filing.
When moving to laser forms, we don’t have multi-parts or color coding so we need to simulate this by printing multiple copies of the form and by marking each copy we print in a special way so that it can be readily identified by the worker (e.g., office copy, customer copy, billing copy). This marking can be accomplished by developing a template that repeats itself across multiple pages and uses elements such as watermarks, or special notations to identify each repeating copy within the template for a particular purpose.
Using the example above, we may wish to create our template so that page one is the Customer Copy, page 2 is the customer copy and page 3 is the billing copy. When the final document is generated from the template, the laser printer will print one print jobs consisting of three copies within the same document.
Illustration showing one template document with three pages; one for each copy. At run-time, one document is generated and one document is printed but depending on the size of the data inserted into the template, each page of the template may become one or more pages in the final document. By using proper form design practices, Blue Prairie Forms will automatically handle this requirement and will also perform many routine form tasks such as auto page numbering, etc.
Placing multiple copies within the same template file offers a number of advantages. Fewer print jobs are generated and have to be processed. If sending to a PDF printer for storage, all copies are contained within one document.
At the time we create templates, we do not know what data may be inserted into the document at runtime. Therefore, each ‘copy’ may end up being one page or more. Yet it is important that we apply the correct watermark for each copy regardless of how many pages that copy becomes.
Page styles in open office allow us to assign a specific header, footer and watermark to each ‘copy’ of the document. If we properly use Page Styles, then Open Office will automatically apply the correct watermark to each copy. Another advantage is that we may wish to have Open Office automatically number the pages within each copy. For example, if we end up with a final document where each copy is three pages and there are three copies, our total page count will be nine pages. By default, if we use Open Office’s automatic page number field within our template and we do nothing special, then the first copy will contain page number 1,2,3 and the second copy (customer copy) would contain the page numbers 4,5,6. Obviously this is not desirable as we would want the page numbering to restart with page 1 when switching to the customer copy so that instead of page numbering like this: 1,2,3,4,5,6,7,8,9 we would instead prefer to see page numbers sequenced as 1,2,3,1,2,3,1,2,3
All of this is easily done with the use of Open Office page styles and by using proper breaks between each template page to change watermarks and to reset page numbers back to 1 when each new copy is reached.
Recommended Reading
We recommend reading the topic Open Office Styles Tutorial
Form Design: Document Elements in Form Design
| See this article about recommended version of Open Office and Libre Office for creation and Editing of templates Recommended Office Versions |
Header
Headers are appropriate to use for content you wish to have repeated at the top of each page. Company logos, table headers, etc are good examples of where headers are appropriate. OpenOffice allows for different headers on different pages (i.e., first page, last page, odd pages, even pages, etc) See The OpenOffice tutorials and examples for a detailed explanation of OpenOffice styles and how to properly use headers with Blue Prairie Forms.
Footers
Headers and like footers but are used when you wish to have content repeated at the bottom of each page. This can be used, for example, when you wish to have document details such as totals repeated at the bottom of each page. OpenOffice/LibreOffice also allow for the modeling of styles so that a footer may only appear on the last page or the first page of a document.
The easiest way to have totals appear only on the last page of the document is to simply place the totals within the document body (rather than in the footer), then it will naturally appear on the last page. This is often simpler then modeling different firstpage/lastpage styles.
Tables
Tables are a good design element to use. They provide an elegant way to organizing information into columns and rows. Using Blue Prairie Forms repeating tag feature, tables can be used to organize repeating data within your forms.
Constraining data within a cell
By default, OpenOffice table cells will wrap when the text within them exceeds the width capacity of the cell. In some situations, this is desirable but in others, such as situations where you wish to have a uniform grid of rows all with a uniform height, it can be problematic. There are two basic approaches to dealing with this situation:
- You can ‘trim’ the value to go into the cell on the host side before it is passed into the document. While this is easy to do, remember that it violates the rule of keeping the formatting of the data separated from the data. We prefer the second approach which is template based.
- You can use the capabilities of OpenOffice to constrain the data even if it would normally cause the cell to wrap.
Templating Technique
The following example uses OpenOffice’s constrained row height feature to prevent a cell from increasing in height when cell contents exceed the space allocated to the cell. To test the technique in a fresh OpenOffice document, follow these directions:
- Open a new OpenOffice document
- Chose Table > Insert > Table from the menu
- Choose setting like this (make sure you have at least two rows)

- This will result in a table resembling this to be inserted into the document

- Now, place the cursor just to the left of the row we wish to constrain until the cursor turns into a bold right arrow and then right-click. A pop-up menu will appear. Choose “Row > Height” from the pop-up menu and the following dialog box will appear:

- Make sure the “Fit to size” box is unchecked and that there is a reasonable height set for the row (.01 is too small and will just display a line across the screen because it is a really short cell.) .27 is usually a reasonable height for a cell.
Now, go into a cell and type as much text as you wish. It will not wrap and a red arrow will appear when the right boundary of the cell is exceeded but the cell will not increase in height. Here is an example:
Example shown just before the upper-left cell’s width is overrun

Example shown just after the upper-left cell’s width is overrun (note the red arrow)

The printed output will not contain the red arrow and will show the left-most viewable area of the cell when printed (this is what we want).

Using Frames to Span Columns in a Table
Sometimes it is desirable to have data flow from one column and spill over into columns to the right. You’ll often find legacy print programs that use this technique to print comments or other documentation interspersed within the normal columnar repeating data.
Because you may model the table columns to be constrained in width, data inserted into the column using a placeholder tag could only be truncated to the width of the column or wrap based on the width of the column. To override this standard behavior of a table column, you can use OpenOffice / Libre Office Frames to allow for spanning of columns so that data from one column can extend into adjacent columns to the right.
Procedure
- Use an existing table or create a new one of multiple columns
- Placed the cursor into a cell of the table where you want the text frame to start. In the example below, it’s in the first row and second column.
- IMPORTANT TIP: If the cell where you intend to anchor the frame is empty, enter a space into the cell so that there is a character within the cell to which the frame can be anchored. If you do not perform this step, it will appear that the frame has not been inserted which can be confusing

- Now, choose Insert > Frame from the menu and the following dialog box will appear:

- Make the changes as shown above
IMPORTANT NOTE: Some users of OpenOffice have reported that the use of “To paragraph” Anchors when using a high number of frames (e.g., > 200 rows with 1 frame each), has lead to considerable loading time for the document. “To character” anchor points do not seem to have this issue so we recommend that users of Blue Prairie Forms avoid the use of “To Paragraph” anchor points within templates, especially for templates that may expand at run-time into hundreds of rows.
- Make sure that all AutoSize and “Follow Text Flow” check boxes are not checked and otherwise check the options so that they match the above. The actual width and height is not important to check and we’ll adjust that in a subsequent step. But it is a good idea to set the position and vertical setting as shown.
Now, select the “Background” tab and choose the color white and then set the transparency to 100%, This will allow the borders of the table rows and columns to ‘show through’ the frame.

- Choose the “Wrap” tab and choose “Through”

- click OK and a frame will appear in the table cell with green corner anchors like this:

- Drag the corners (green anchors) of the frame until it is a size and position that you desire. Remember that it is very important that the frame be attached to the paragraph mark anchor. This is indicated by the little anchor symbol being hovering over the paragraph mark as shown above.
- If after dragging the corners of the frame to the desire size, the anchor moves to another cell or if you find it difficult to get the frame and the anchor to co-exist next to each other, it could be because the frame is set for ‘center’ justification (meaning it will attempt to be placed in the center of the cell rather than left justified and placed at the left edge of the cell. To correct this, select the frame so that the green corner markers are visible and then press the left justify icon in the toolbar:

- Size and position the frame so that it envelopes the columns that you wish to have your text ‘overflow’ into (sample shown below):

- Now click inside of the frame and add your desired tag like this:

As the ‘row’ is repeated, the frame within it will also be repeated. This will allow text to ‘flow over’ a number of columns because it will be constrained by the frame. Also, you can choose to eliminate borders on the frame so that these are not visible.
You can play with that to get a look that works for you. In theory, if we have a tag that is only for data if it should be in the frame, then the frame will be repeated along with each row for the number of rows of data but if the tag to be placed within the frame is blank, then only an invisible frame will be repeated in that cell. Now, if a row contains non-flowing data, it works and if there is data for the flowing frame, it will also work.
Where to place tags
Remember that you’ll want to include tags into the actual proper columns of the table for the data that normally appears in the columns. We’re simply adding the frame to handle special exceptions when non-standard data needs to appear in a row of the table and the data should span multiple columns. So, as you model the table, it might actually look more like this before you add the frame:

After adding the frame to allow spanning, the table row would look like this:

Notice that the frame is over the table row and that the anchor icon is attached to the paragraph mark in column 2 of row 2. This means that the frame resides in row 2 column 2 and then when the row itself is repeated, the frame should also be repeated.
Also note the there are two tags (%partNo% and %myTag%) that seem to be overlapping but not quite aligned. We’ve purposely misaligned the two so that you can see both tags in this example. In practice, you would probably align the frame so that the tag within the frame lays directly over the tag in column 2 row 2 of the table.
When then print program (MultiValue Host) creates the tags for this row, if the print program was going to print data that spanned columns, then the print program would place the spanning data into the %myTag% tag and would set the other tags behind the frame in the actual table row (%partNo%, %desc%, %price%) to null. Now, the data in the %myTag% tag would not collide visually with anything behind the frame within the actual table cells
If the print program is not printing spanning data, then the print program would need to set the %myTag% tag to null and the other tags within the table row (%lineNo%, %partNo%, %desc% and %price%) would contain proper values to be display.
Since the frame was configured to use white background color with 100% transparency, the table cell boundaries would be visible through the frame. This simulates the effect of printing across a pre-printed form.
Blocking column borders when spanning
You can employ a trick to ‘erase’ the column borders when the spanning tag is used. To do this, create two images somewhere in a URL visible to the print server (you can store it on the print server for fastest performance). You must use an image format that supports transparency. JPG does not support transparency but PNG does support transparency.
|
Image name |
Size |
Color |
|
transparentBackground.PNG |
Large horizontal rectangle |
Transparent |
|
whiteBackground.PNG |
Same as above |
White |
Procedure
- Right click on the frame and choose “Properties”
- Choose “Background” tab

- Choose “As” to be Graphic
- Click browse and find the transparentBackground.PNG file stored on the linux print server
- Make sure that ‘Link’ is selected
Of course, the example URL shown above is wrong and reflects a url on this author’s PC where he left a sample image. The URL you’ll have should be a URL from the print server where the image has been placed. The easiest way to make this change is to VNC into the print server and run OpenOffice or LibreOffice from there and then browse to the transparentBackground.PNG image. But for the purposes of this tutorial, it does not matter. All we need is to have the frame set for a background of “graphic” and some URL inserted into the frame. When the print program grabs the template to create the final document, the entire URL or the “transparentBackground” part of the URL will be swapped to the actual image URL you wish to use as the background.
So, in the print program on the MultiValue host, you’ll set a tag that is within the tag block for the repeating data set called transparentBackground and it will be set to the string “transparentBackground” if you want a transparent background for that row.
If the row in the repeating set calls for the background of that row to be white to block out the cell borders, then for that row, the tag transparentBackground to a value of “whiteBackground” instead of “transparentBackground”.
When the document is rendered, depending the preference of the print program, the frame for that row will either have a transparent background which does not block the cell boundaries or a white background which does.
Or Replace the Entire URL
Technically, you could also replace the entire URL with another using the same technique. This would be helpful in cases where you aren’t sure where the image will be stored and would rather replace the entire background graphic URL rather than just the file name part of the URL.
Tab Stops and Rulers
For data that needs to flow over a number of pages, one practice is to format the columnar data using tab-stops and then embedding tab characters (odt/tab format) into the tag data. By formatting the data this way, OpenOffice will automatically handle the pagination and render the headers and footers and appropriate to create the final document. See the Blue Prairie Forms api documentation for how to create repeating data using odt tabbed tables.
Frames
Frames are useful when you wish to have data overlaying a section of the document and do not wish to have it affect other parts of the document.
External Images
ODT format allows the template designer to embed images into the document or to place an external reference to a image into the document. The external reference technique is preferred in most cases because, since the image is not stored inside of the document, the documents are much smaller. However, for documents to be delivered to customers, make sure that the URL to the image is accessible outside of your firewall... otherwise, the user will see a ‘broken image’ placeholder instead of your desired image. External images can be used for logos, pictures, and even signatures (to marry a signature to the document). See the OpenOffice documentation for more information about images and externally linked images.

Headers and Footers in OpenOffice
Header Example
The header generally repeats at the top of each page. OpenOffice allows for a variety of header option including even/odd page header, first page header, last page headers, etc. When designing a template in OpenOffice for use with Blue Prairie Forms, all of the OpenOffice capabilities are available to you as a form designer.
In the example above, we used for our logo, masthead, Statement, date, customer name, customer ID page number and we added a table to hold the column headers for the data that will display in the yellow document body.
Document Body Example
The columnar report data in the sample above was injected into the BODY of the OpenOffice Document using a single tag. The tag was replaced by a large data set whereby each column was separated by a tab mark and each row was separated by a newline mark. Rulers were applied to the tag to define the position of each column and each column’s justification (left, right, justified, etc).
Because the large data set inserted in place of the tag had a greater number of lines than could be displayed within the available space in the document body area, OpenOffice automatically paginated the output causing the data to flow onto page 2 and beyond. No programming was required to count lines or inject page breaks.
In release 3.0 of Blue Prairie Forms, OpenOffice tables can be used to render tabular/columnar data. Special tags have been developed to associate sets of repeating transactional data with a conventional table object rather than using tabs and lines. The tables auto-adjust with rows being added as needed to accommodate the number of rows in the data being presented. OpenOffice handles the pagination according to the rules defined in the OpenOffice options. See the section entitled “Repeat Tags” for more information.
Footer Example
Footers are used to display data that should be repeated at the bottom of each page. OpenOffice supports options similar to header options to allow for different footers for the first/last page, odd/even pages and other specialized controls. In the example above, we used a table followed by a normal document (non-tabled) area for footnotes, etc.
Frame Example
The section of the above example to the left that is flipped ninety degrees was done with an OpenOffice Frame. Frames are useful for defining areas of the document where certain text sections should be confined or styled in a particular way. In the example above, we flipped the address information 90 degrees to show through a windowed envelope.
Images
OpenOffice support images that can be either an image embedded within the document or a reference for a document stored externally to the document and references via a URL. The URL-based image insertion method is preferred because the image does not live inside of the document and this means that the resulting documents are smaller. However, the URL to the Image must be visible on the network wherever you intend to distribute the document. Note that image URLS may contain tags (placeholders). This can be useful when the image you wish to display depends on data within the document. For example, if you wanted to display a photo of the sales person on an invoice, you could insert an image into the document template and then modify the URL to the image to look something like this:
http:/mydomain.com/images/salespeople/%salesRep%.jpg
If the placeholder tag %salesrep% was set to the value of “rick” then the Blue Prairie Forms would alter the above url to:
http:/mydomain.com/images/salespeople/rick.jpg
Remember that if you are inserting an image based on a link, it is vital when using Open Office to set the URL of the file, to check-mark the 'link' option as circled in red below. This causes Open Office to seek the image at the URL rather than saving the image into the document itself. Especially in cases where you intend to embed an image with a name based on a BP Forms tag, you must check 'link' so that Open Office will load the image from the URL when the document is opened and/or rendered.

Tables
Tables can be an extremely useful element when designing forms. In the example above, you can see that we have used tables in the headers and footers to control formatting and placement of the various elements.
When dealing with repeating data such as invoices that may contain many rows of repeating data, we have special tags that can be used within OpenOffice to allow OpenOffice element such as table rows to repeat for as many rows as the data being sent from the host. For example, if you have an invoice with 10 rows of data, you can create a table of one row and then add special tags to the table to cause that one table row to repeat for as many rows (10 in this example) as you have rows of data. A further description of special tags can be found elsewhere in this document.
Template Tags
Blue Prairie Form templates contain static elements and dynamic elements. Static elements are those that look exactly as they appear in the template when final document is produced. Dynamic elements change depending on the data being passed to the document for presentation. Consider the following snip from a Customer Statement template:

On the pages to follow, we'll break out and explain each section of the example template.
Template Example Detailed Explanation

This is the header section of a sample statement template.
|
Element |
Description |
|
IWI Logo |
(static) is a JPG image. |
|
“Please Send all...” |
(static) is simple text along with all of the text in the lines below it |
|
STATEMENT |
(static) is simple text |
|
%s_stmt_date% |
(dynamic) is a tag placeholder. When the document is rendered, this tag will be replaced with the actual statement date of the statement document |
|
Page | 1 |
Page | is simple text but the 1 is a OpenOffice field that displays the current page number. |
|
%c_name% |
(dynamic) is a tag placeholder. When the document is rendered, this tag will be replaced with the customer name for the statement |
|
Reference... Customer Ref... |
This is a simple one tow eight column table that will be the column headers for the body of the document where the actual statement detail will appear. Since this is in the header, it will repeat at the top of each page. |
There are several other tags that we have not documented because they are basically the same as the others
It is important, however, to note that there are two tables in this header snip; the one that holds the logo, mast head , page number and another that shows the column headers for the detail lines of the statement. This illustrates how a combination of word processing elements mixed with tags can allow presentation of a concise and easy to define header structure using conventional word processing techniques.
The snip below is a expansion of the operative part of the template
![]()
|
Element |
Description |
|
Previous Total Due |
This is static text that serves as a label. Note that it is one tab position from the left margin. This was achieved by simply pressing tab to move the cursor to this position. |
|
%s_prev_bal% |
This is a dynamic tag (placeholder) showing where the previous balance should be inserted. Note that this is several tab positions to the right. By using tabs, the previous balance value will be inserted into the final document at this tab position. This happens to be in the “Credits” column. |
|
Prev Bal |
This is static text that serves as a label |
|
%s_prev_bal% |
This is the same as %s_prev_bal% above only it appears in the rightmost tab position. In this example (above), the text will appear right justified in the Amount column. |
The snip below is a expansion of the footer of the template. This will repeat on each page because the footer specification in the OpenOffice document is set to repeat.

|
Element |
Description |
|
%s_age_lbl_1% |
This is a tag placeholder showing where to insert the label for this column. In the example final document (above), this reads 0-30 which is the column header. For this example, the business application statement generation program examined the customer records and only if the customer has a balance in a aging bucket (0-30, 31-60, 61-90, 90 over) does the statement print a label on that aging box. So, if the customer has only 0-30 aged balance and no 31-60, then only the box label for 0-30 will appear and the other boxes (2, 3 and 4) labels will be blank (along with the balance below). |
|
New Balance |
This is static text |
|
%s_cum% |
This is a tag placeholder for the cumulative balance |
|
All NSF... |
This is static text |
|
Codes... |
This is static text |
|
PLEASE SUBMIT... |
This is static text |
Note that in the snip above, we have a table with two rows and six columns. The text appearing below the table was created with straight text (no table) and tab stops.
![]() |
The snip to the left contains two OpenOffice frames with text inserted. It is used as a reference tab to help those who stuff envelopes detect the beginning of the next statement and with reference information to easily match to its mailing label. We created this in OpenOffice by creating a new frame, anchoring it to the page (not the paragraph) and then dragging it to the left page border. In addition, we changed the properties of the frame to allow vertical orientation of the text. |
Using Special Characters for Effect
Most word processors, including Open Office / Libre Office provide a wide range of fonts with special character sets that can be used to enhance your forms. Using these special characters can be done by simply:
- Load the template document into Open Office / Libre Office
- Click where you wish for the special character to appear
- Choose Menu>Insert>Special Character
- Select the font set (hint: Wingdings, Wingdings2, and Wingdings3 contain many useful and scalable glyphs)
Special Characters: Wingdings2
After inserting the symbol into the document, you may select it then change the font size to make it larger or smaller. Special symbols allow you to create many attractive effects within your form templates without resorting to the insertion of images. This keeps your templates small, fast and scalable.
Example Form Template with Special Characters
Note:
- The icons (special characters) used for email, address and phone. These all came from the wingdings2 special character set.
- The Swoosh-Right_arrow to the right of the "Please pay this amount" label came from the wingdings3 special character set.
You may explore all of the font sets available in open office to find and use eye-catching icons and special characters for your templates.
Related Links:
Managing Services
You can view status and manage services running on the BPF server by choosing System > Administration > Services from the menu. One service that is vital for BPF is CUPS (the printing system). Without it, no printing will be accomplished. You can check the status of CUPS using either the CUPS Printer Page (described elsewhere in this document) or simply access the console and see if there is a ‘green light’ next to the CUPS service.

