Home > Commands > Tools > Report Writer > Templates: Inserting Form Fields

Templates: Inserting Form Fields

When authoring a Report Writer Template, you’ll need to replace each data item in the template document (i.e., number, date, and character string) with a Form Field that refers to a data item in the Report Writer. This article describes how to:

Inserting a Field

In the Report Writer, you can right-click to Insert Field while viewing User-Defined Data, Asset Data, Valuation Sets, Deterministic Forecasts, Gain/Loss Analysis, or Descriptive Statistics. First, switch to Word and position the insertion point of your Word template document where you want the new field inserted. Then:

image/ebx_-1422299287.gif

If you are willing to accept the default format (the first one) you may use the keyboard shortcut Ctrl+I.

Note regarding percentages: If you use any format that contains a percent symbol, Word will automatically scale the number up by a factor of 100, in the same way that Excel does if you click the "%" button on the Excel formatting toolbar. For example, if you have a decimal value of 0.065 and choose a format of "0.00%" then Word will show "6.50%" in your document. However, if you have a percentage value of 51.2 (meaning 51.2% female, for instance) and you use a format string of "0.00%", Word will show "5120.00%". In this situation, choose one of the formats with the "divide=100" option. Report Writer will divide your number by 100 before passing it to Word; Word will then scale it up by 100 and add the percent symbol, so you will see "51.20%" in your document.

Inserting multiple fields at once is useful for tabular data, such as active age/service scatter charts and inactive counts and benefits. However, to insert multiple fields at once, we recommend that you do not place the insertion point in a Word table. Rather:

 

Editing a Form Field manually (optional)

After inserting a Form Field, it might be useful to edit it manually. For example, to calculate a derived value (negate the value, add two values together, take the maximum of two values, etc.) or change the formatting style. To get started:

Then, for each form field:

  1. Type. Most fields will be Number. Use Regular Text for something like the actuary's name. Use Date for dates such as the valuation date.

image/ebx_-722827426.gif

  1. Format. The choices here depend on the field type you chose.

For Regular Text fields, you probably don't need to specify any format. But there are a few choices available:

image/ebx_1224489052.gif

For Number fields, choose the desired format depending on whether you want decimal places, dollar signs, and so on. If the format you want is not shown, you may type in a custom format. Note regarding percentages: If you use any format that contains a percent symbol, Word will automatically scale the number up by a factor of 100, in the same way that Excel does if you click the "%" button on the Excel formatting toolbar. For example, if you have a decimal value of 0.065 and choose a format of "0.00%" then Word will show "6.50%" in your document. However, if you have a percentage value of 51.2 (meaning 51.2% female, for instance) and you use a format string of "0.00%", Word will show "5120.00%". The Report Writer has a way to correct this with its DIVIDE=100 option, which is explained above.

image/ebx_-1209571423.gif

For Date fields, choose the desired format.

image/ebx_-1478924332.gif

  1. Field specs. The "field spec" that tells Report Writer what data item you want, or the formula to derive a value (the example below negates the value of the ABO). The field spec is entered as the Form Field's help text -- click the Add Help Text button to edit. See Templates: Form Field Reference for the syntax. Note that at this point Report Writer has no idea whether your field spec is valid. It's not until you Publish a document that the fields are verified.