Text
Write static text and bind data into it. Components in the DocStudio designer user guide.
What it is
A text element shows text made of segments. A segment is fixed text or a binding or calculation, so one element can read "Invoice " followed by the invoice number.
When to use it
Titles, labels, values, paragraphs and notes. For a list of items use a repeater or a table.
Insert
Click Text in the toolbox, or drag it onto the page.
Configure
Select the text. In the Content group of the inspector:
- Add text adds a fixed text segment. Type the words.
- Add binding adds a data segment. Choose a path, add a fallback or wrap it in a function such as
upperorformat. - Use Move up, Move down and Remove to arrange the segments.
Segments are joined without spaces, so include spaces in the fixed text: Hello and then the name.
Data binding
A bound segment reads a value from the data. If the value is missing the page policy applies (a dash by default). Numbers and booleans are converted to text. A list or object cannot be shown as text and reports a wrong-type problem. Format dates, numbers and money with formatting.
Styling
Open the Style group: font size, weight (normal or bold), style, family, color, background, text align (start, end, center, justify), line height, letter spacing, padding, margin, border, opacity, direction, white space, overflow wrap and text decoration.
Positioning
In a flow container the text takes the width of its container. Give it a width in Layout to narrow it. In a fixed region drag it and set w and h in the frame.
Limits
- There is no on-canvas typing. Edit text in the inspector.
- There is no rich text inside one element: use several elements for different styles.
- Long text wraps. In a fixed region it can overflow the frame height, and the frame does not grow.
Example workflow
Add a text, Add text "Dear ", Add binding customer.name, Add text ",". With the data { "customer": { "name": "Ada" } } it reads "Dear Ada,".