Filter – Bookmark Templates

This entry is part 9 of 19 in the series Setup Guide - Bookmark Templates

The RR_ and RC_ prefixes process repeating data, but there may be rows you do not want to display. The xFilter_ bookmark allows you to explicitly define which rows to include. The bookmark can be used to filter any or all tables in your template. You can also use advanced expressions with the xFilter_ bookmark.

In most bookmarks, the bookmark is placed in the location were you what the data to be placed – BUT the xSort and xFilter bookmark are different. These bookmark give Spitfire a command to Sort or Filter an existing bookmark with specific criteria.

The xFilter bookmark has multiple parts: xFilter_alias  =  fieldname  operator result

For example: xFilter_DocItem = ItemStatus = ‘O’  means  Filter the Doc Items in this document to only include items with a status of O(pen) are included

xFilter_DocItem  is the instruction and the “name” of the bookmark (marked in yellow)

– and ItemStatus=’O’ is the criteria and the placeholder for the xFilter_DocItem bookmark

The green highlighted area is where the Doc Items are to appear (RR_DocItem_Description, RR_DocItem_ItemType, etc.) but the xFilter_ bookmark is going to limit the Items printed in this document to only those with the Status = O for Open.

To filter all references to an alias in a template:

  1. In an unused area, type xFilter_Alias – fieldname operator constant
    Alias is the Spitfire alias for the Table containing the field on which you’d like to sort; fieldname is the name of the field on which you want to filter (remember that each bookmark name is comprised of xFilter_alias and a fieldname), operator is one of the comparison symbols/operators (<, >, ≤, ≥, =), and a constant is the number or text you want to filter by.
  2. Format this line as Hidden Text.
  3. Highlight the text following the equals sign (=).
  4. From the Insert ribbon, click Bookmark.
  5. In the Bookmark name field, enter the text before the equals sign (xFilter_DocItem).
  6. Click Add.

Tip: WordTemplateConfig rules (set through the Rules Maintenance tool on the System Admin Dashboard) can also be used to filter. Using the rule is generally easier to maintain. See KBA-01323 for more information.

If you had a table with the following bookmarks:

Item No. Description
RR_DocRevItem_ItemNumber RR_DocItem_Description

and if you only wanted to include those rows with the Original Quote not equal to 0 (zero), you would type:
xFilter_DocItem = OriginalQuote<>0
and if you wanted to include only those rows with the Description equal to Labor, you would type:
xFilter_DocItem = Description = ‘Labor’

To filter a list within a table in your template:

  1. Click the table selection icon to highlight the table you would like to filter.
  2. From the Insert ribbon, click Bookmark.
  3. In the Bookmark name field, enter any name that either begins or ends with the word “Table”.
  4. Click Add.
  5. Use this bookmark name to create a new prefix by adding it to the xFilter prefix (ex: xFilterTable1_)
  6. Follow the directions for using the xFilter_ prefix but use your newly created xFilterTablename_ prefix in its place. (ex: xFilterTable1_DocItem = ItemStatus = ‘O’   and   xFilterTable2_DocItem = ItemStatus <> ‘O’)

Table1 – Items Still Open

Item No. Description Status
RR_1_DocRevItem_1_ItemNumber RR_1_DocItem_Description RR_1_DocItem_Status


Table2 – Items Closed

Item No. Description Stasus
RR_2_DocRevItem_ItemNumber RR_1_DocItem_Description RR_2_DocItem_Status


**Note the RR_1_ and RR_2_  – the addition of the 1_ and 2_ make each bookmark unique. Microsoft Word only allows unique bookmarks. Therefore, you cannot use RR_DocRevItem_ItemNumber in two different tables without making the “unique”.  Adding the 1_ and 2_ to the bookmark RR_DocRevItem_ItemNumber makes it unique.


Series Navigation<< Sort – Bookmark TemplatesWordTemplateConfig Rules – Trouble-shooting Rules >>