On line guide/help

You are on page 17 of the online help. Navigate sequentially through the guide pages or search for a topic of interest to you.

Index Prev. Next

Box

Draw a text

The box element (or its alias text) prints text in an area defined by a pair of coordinates. The area can optionally be bordered and filled with a single color or a two-color gradient.


Parameters

Elements / attributes of the <box> / <text> element:

Coordinate parameters (required) that define the print area of the text
<x1> (or <x>) Starting X coordinate (upper/left corner)
<y1> (or <y>) Starting Y coordinate (upper/left corner)
<x2> Ending X coordinate (bottom/right corner)
<y2> Ending Y coordinate (bottom/right corner)

Instead of x2 and y2, the size of the print area can be set (one of the two methods is required):
<width> Width of the print area, starting from the X coordinate
<height> Height of the print area, starting from the Y coordinate

Parameters that define the text:
<text> Text to print (empty string if not set). Placeholders, eg. {VAR_NAME} or {dataset.field_name}, are dynamically replaced by data (variables or data provider fields). Line breaks in the text are printed.
<format> (aliases: <valueformat>, <mask>, <valuemask>) Optional format mask applied to the text value, eg. F2 (float, 2 decimals), I (integer), P1 (percentage, 1 decimal), C2 € (currency, 2 decimals, € symbol). See the Value formatting page.
<align> (aliases: <textalign>, <horizalign>, <texthorizalign>) Horizontal text alignment. Possible values: L or Left (default), C or Center, R or Right, J or Justify
<vertalign> (alias: <textvertalign>) Vertical text alignment. Possible values: T or Top (default), M or Middle (also C or Center), B or Bottom
<textfit> How the text is fitted into the print area when it is too large (see the Text fit page). Possible values: Auto (default: truncate the text; if the text cannot be truncated, scale down the font), Truncate, Resize (scale down the font), None (print the text as it is). The default mode can be changed with the textfit element.

Other parameters:
<border> Border. Possible values:
1 Show the border (default)
0 Hide the border
LTRB Show only some sides: any combination of L (left), T (top), R (right), B (bottom), eg. LR or TB
<linestyle> Line style of the border (if not set, the default line style is used)
<fillstyle> (or <fill>) Fill style of the print area (if not set, the default fill style is used). Solid and gradient fills are supported.
<font> Font of the text (if not set, the default font is used)
<rotateangle> (or <rotate>) Rotation angle in degrees (0 - 360, default 0 = no rotation). The whole box is rotated around the x1,y1 corner.

Optional parameters.
<printif> Optional expression: the element is printed only if the expression is true, eg. {doc.type}=1. See the Conditional printing page.

If the text is longer than the first line, it is automatically wrapped over the following lines of the print area. With the default textfit mode (Auto) the text exceeding the print area is truncated.
Related topics / download links / see also..
21 - Font

Example

Some examples of text boxes: fill with gradient, formatted value, text fitting and rotation.

Box examples