Dunning Notice Sample

The Dunning Notice sample demonstrates the behavior of a dynamic PDF form.

The sample has three available Dunning levels. The information appropriate for each level should be printed along with a list of the unpaid documents.

The sample includes these files:

File

Description

Dunning Notice.xdp

Designer form file located in the Forms folder.

Dunning Notice Level1.xml

Dunning Notice Level2.xml

Dunning Notice Level3.xml

XML data files located in the Data folder. The data file for the Level 3 Dunning notice contains enough invoices to overflow onto a second page.

Dunning Notice.tif

Image file located in the Images folder.

Dunning Notice Level1.pdf

Dunning Notice Level2.pdf

Dunning Notice Level3.pdf

Rendered forms with merged data located in the Outputs folder.

To run the Dunning Notice sample

  1. Open the Dunning Notice.xdp file, located in \EN\Samples\Forms\Dunning Notice\Forms, in Designer.

  2. To specify the preview options, select File > Form Properties.

  3. Click the Preview tab and do the following tasks:

    • In the Preview Type list, select Print Form.

    • In the Data File box, browse to the Data folder and select one of the sample data files (for example, Dunning Notice Level1.xml).

    • Click OK.

  4. To preview the form, click the Preview PDF tab.

The output sample PDF files in the Outputs folder show the rendered form merged with each of the three sets of data. Use these files to compare to the results of the previewed form.

About the Dunning Notice form

The form demonstrates several features.

Form hierarchy structure
The Dunning Notice form is based on the data structure in order to take advantage of the implicit data binding process.

Master page
Two master pages are required. The first one displays the company logo, form title, and static text. This page is the first page to print and appears on an odd-numbered printed page. The second master page is used for every subsequent page. The same static text is displayed as well as the page numbering.

Page numbering
The page numbers are calculated values obtained by inserting run-time properties into a Text object.

Flowed content
When data is merged with the form, the subforms are placed one below the other by setting the subforms’ parent (dunningNotice) Content option to Flowed. The Content option is on the Subform tab of the Object palette. The Flow Direction list, also on the Subform tab of the Object palette, is set to Top to Bottom. The subform margins, specified in the Layout palette, add the extra spacing required between two subforms.

The header, level1, level2, level3, and closing subforms also have flowed content. The field margins add the extra spacing required between two objects.

Subform occurrence
The form includes a number of subforms that work together to properly accommodate the data. The subforms themselves are a mixture of repeating and non-repeating subforms. The minimum count values of all subforms, except the detail header and closing subforms, are set to 0 to specify that only the required subform will print. The maximum value of each non-repeating subform is set to 1. The repeating subforms do not have a maximum occurrence value because the number varies for each set of data. The minimum count value of the closing subform is set to 1 because no data is available to instantiate the subform.

Detail header
The detail header displays the column headings and should print before the first detail line. This detail header information should repeat at the top of the page when the detail lines can no longer fit on the current page and flow on to a new page. Setting the minimum count value of the detailHeader subform to 1 ensures that the header is always printed at least once.

Overflow leader
The detailHeader subform is associated with the document subform as its overflow leader. This feature forces the overflow leader subform of the document subform to print every time the document subform flows onto a new page. Because there are no fields in the detailHeader subform, the Data Binding option, on the Binding tab of the Object palette, is set to No Data Binding.

Global fields
The currency value is provided once in the data file. By setting the default binding of the currency field to Global and by using this field in multiple locations, the value is replicated in each occurrence of the field.

Image field
Because the company logo may vary, the logo file is embedded in the data file. An Image Field object is used to display the image.

Maximum number of characters for each field
The maximum characters value for each field is specified as per data specifications. The Max Chars option is on the Field tab of the Object palette.

Expandable fields and anchor position
To accommodate data values of varying length, the Expand to Fit option in the Layout palette is selected for the billToAddress, Salutation, and Closing fields. The anchor position of these fields is set to allow the field to expand in the proper direction.

Variables
The closing of every paragraph is the same. For easier maintenance, its value is defined as a variable, and a script is used to reference this value and display it. Because the field’s value is calculated, the Data Binding option is set to No Data Binding.

Scripting
The address values should be displayed as a block. A JavaScript script is used to concatenate the data values. Because the billToAddress field’s value is calculated, the Data Binding option is set to No Data Binding.

Multiple line field
The billToAddress field’s Allow Multiple Lines property, on the Field tab of the Object palette, is selected so that the calculated value can print on several lines.

Floating fields
The level3 subform contains both text and fields. Using floating fields results in a natural flow of the information. A display pattern can be specified directly on the field and displayed in the paragraph. Use the Patterns option on the Field tab of the Object palette to specify a display pattern. The floating field is a hidden field inserted into the Text object. The reference to the floating field is represented by the field name between curly braces; for example, {fieldName}.

Picture patterns
Some values are easier to read by applying a display pattern. For example, the level3 subform’s deadline value is formatted with a medium-length date for data pattern value on the Binding tab of the Object palette.

// Ethnio survey code removed