Text style element

Text style element

You can use a style in InterFormNG2 to set multiple, fixed global styles in a template, but with the text style element you can set a local, dynamic text style instead.

 

You can add a text style in the middle of a template in the designer by clicking this icon:

NG2TextStyleElement0001

 

The properties of the text style element looks like the normal style:

 

NG2TextStyleElement0002

 

Here you define a name for the style (MyStyle in the example above) and set all the text attributes, that are to be used, when this text style is selected in a text element.

 

If you later insert a text element, then the locally defined text style elements are shown first before the normal, global styles like below:

 

NG2TextStyleElement0003


The colors available for the text style element are the colors defined on the color palette for the tenant settings.

 

Examples of how the text style can be used

You can use the Text style element together with a common template component to make the common component present some text in the way, that the calling template has specified like below.

 

Example 1: Set the style in the template and use it in a common component.

In this example we want to print out an address on all the business documents in the same position, so we choose to print it out in a common template component. In this way we can easily move the address around to fit a special area for all documents, but still the various documents (that are setup in the main template) can still setup a common text style to present the address in a specific font or even define different wrap around options, if a line in the address is too wide.

 

Here we consider an address like this:

 

NG2TextStyleElement0004

 

So for the ShipAddr1 field we might consider to either cut it at a specific length or to wrap the text in a smaller font.

 

Here we define one template (Address_cut), that activates the wrap around option on the common text style, Address before calling the common component.

 

The style looks like this:

 

NG2TextStyleElement0006

 

And the setup

 

NG2TextStyleElement0005

 

The text in the component is setup to use the Address text style:

 

NG2TextStyleElement0007

 

The result here is, that the company name is cut of at the available length.

 

Now we have another main template (Address_wrap), that also calls the same common template component, but here the Text style is set to wrap:

 

NG2TextStyleElement0008

 

The result here is, that the company name is wrapped to multiple lines in the address.

 

 

Example2: Print out the amount in red, if it is negative - but we only want to insert the text element once.

 

That can be done, if we define the text style element depending on a condition and then use the same style on the text afterwards like below:

NG2TextStyleElement0009

 

Here we use a text style, that we call color, that is first set in one of the select..when branches and then used in the subsequent Text, that prints out the amount in the color.

 

In this way we can change the color to red, if the amount is less than 0:

 

NG2TextStyleElement0010


    • Related Articles

    • Text element

      If you want to insert any kind of text in InterFormNG2, then you should use the text element. You can insert a new text element if you click on this icon: The data, that you can output as text are these types: 1.A text constant. 2.Drag nodes from an ...
    • Edit document text

      The advanced, utilities component, Edit document text is used in combination with the Webforms module. One prerequisite for this component is, that you have already setup a template with one or multiple editable text elements. This workflow component ...
    • TEXT

      It is possible to define a workflow, that accepts text files as input. The default encoding is UTF-8. You need to convert the input text file into a spooled file, if you want to use a text file as input for a merge with a template. You can do that ...
    • Table element

      You can use a table element to insert design elements in organized rows and columns. Each cell in the table can be surrounded by a border and/or filled out with a color. You can even create a dynamic table with a row for each detail line in the input ...
    • Comment element

      You can use the comment element to document the structure and changes to templates. To insert a comment in your template you need to insert the comment element with this icon: You find this icon by clicking the '+' icon to reveal the second row of ...