Text Element
  • 07 Jun 2022
  • 11 Minutes to read
  • Dark
    Light

Text Element

  • Dark
    Light

Article Summary

Intro

As the name suggests, the text element lets you add your custom text to the report. For example, you can use this element to add headings for your report, page titles, or use variables and Qlik expressions for dynamic content, like page numbers, time/date, KPIs, filter values and more to the report.

You may use the text element to specify headers and footers for your report. For example, to add copyright information at the bottom of each page or add a category as a header. Again, all this is possible with the ancoreShare Designer.

A special feature here is the option to transform the content of your Text element to a Barcode on your report.

The following sections explain how you can work with text elements to use their powerful functionalities.

Basic Settings

Add and select a text element and set general element properties.

Adding text element

To add a text element to your report, drag the text icon onto your report designer sheet.


Title and alignment

When you add a text element, the Title is automatically populated as New Text n, where n is the number of the text element added to the report.

You can edit this field to enter static content to your text element.
It's also possible to click the Text element twice on the designer sheet and enter your content directly there.

If you set dynamic content for this element (see next section), the title will only be visible in the designer and will get replaced with the dynamic content when exporting the design.
In this case giving the element a title can still be useful, for example to approximately plan the space for the dynamic content or for navigating through your elements on the sheet.

Alignment

Use the alignment buttons to justify the content of the Text element left, center, or right.
You can also align the element itself on the page. Learn more about that in Element Settings.


Dynamic content

This is the area where you can specify dynamic content for your element, like page numbers, the date, KPIs or filter values.

You have two options to create dynamic content, either by using the built-in ancoreShare variables for things like page number or the report name, or select a Qlik Source to access any kind of Qlik Expressions or variables from that app.

ancoreShare Variables

The icons displayed above the content area offer the following variables from left to right:

    • Number of the current page*
    • Total number of all pages in the report* 
    • Date at the time the report is being generated
    • Time when the report is being generated
    • Name of the report in ancoreShare
Click on an icon to paste the ancoreShare variable in the content area.
You can combine multiple of those variables with each other and with text.

*Page numbers are in respect of the actual export, not the pages in the Designer, as pages can get added up by generating them automatically/dynamically due to tables spanning over several pages or a page cycle repeating pages with different values.

Tip
Use the Title with dummy text to better plan the space that will be taken by this element on the page due to dynamic content.

For example, paste "Page %%Page%% of %%Pages%% " to create "Page 1 of 5" on your export.
To better plan the space for this sample Text element, give it a Title like "Page X of X". This gives you a good idea of how much space the element will take on the report.
Or another example would be to set the Title to "YYYY-MM-DD" when working with a date variable, or things like "###.##" for numeric values.

Qlik Expressions

Using Qlik Expressions and Variables lets you include KPIs, sums, selection or filter values and other data from your Qlik apps in your report.

To use this functionality, you need to select a Qlik Source first. If your report has not more than one Source defined, it will already be pre-set. Should you have multiple Sources connected to your report, you need to choose the app that contains the relevant data for your expression.

Qlik Expressions must always begin with "=".

Tip
If possible, go to a Qlik app and test or create your expression in Qlik e.g. in a Text object there.

This way you can make sure that your expression is correct.

The Qlik Expression Editor can also give a lot of help and context, like pasting functions or helping with syntax - especially when working with more complex formulas and combinations.

Let's see some examples for dynamic text content:

Examples

Here are some examples for dynamic content in Text elements - see the result for each example in the images below.

Date

Use the ancoreShare variable icon. You will see the pasted date variable as follows in the content field, and this will display the current date on the report at the time when the export is being generated.

Result:

KPI

Specify the following Qlik Expression to add a KPI, such as the sum of sales to the report.

= num(Sum([Sales Amount]),'#.##0',',','.')

Result:

Combine expression with text

Specify the Qlik Expression as follows to combine your text with a KPI.

= 'My KPI: ' &  num(Sum([Sales Amount]),'#.##0',',','.')

Result:

Top 5 rank

Specify the Qlik Expression as follows to populate the top 5 ranking from your filtered data. In this example, the expression will fetch the currently filtered data (e.g. the states), sort the values of their corresponding value (e.g. sales), and lists the top 5 of them - e.g. creating a rank of the 5 top-selling states.

='TOP 5 STATES BY SALES' & chr(13) & concat({<[state_name] = {"=Rank(Sum([Sales Amount])) <=5"}>} DISTINCT [state_name],chr(13))

Result:

Refer to the Qlik documentation to know more about Qlik Expressions.

Link URL

The Link URL setting allows you to add any kind of link to the Text element. When the report is generated, the URL is embedded in it. Clicking the text on the report redirects the user to the URL specified here.

Setting a link is particularly useful when you want users to access the live view of your app content in the Qlik environment.

Make sure the users have sufficient access rights.


Filtering data

Using the Filter settings, you can restrict, reduce and focus the data that you want to show on your report, from the Qlik application.
Learn how filters work, important details, and see some examples in Filtering Data.

To access filter settings for text elements, perform the following steps.

  1. On the report designer page, select the element for which you want to filter data.
  2. Make sure you already selected a Source in Content.
  3. Click the Filter tab from the settings bar.
  4. Click on a row area below in the filter list - in an empty row for adding a new filter or on an existing one for editing this filter.
    This opens a Filters dialog box.
  5. Enter or choose the Qlik Field on which you want to apply the filter or provide a Qlik Expression.
  6. Define values of this field that should be set as Filter.
    One filter must contain one or more field values.
    Use semicolons to provide multiple values. In this case, OR logic applies to the field values.
  7. Optionally you can add a Variable from the drop-down boxes.
  8. Click on Apply.

Top and Pareto

This setting is only available for QlikView sources. It lets you conveniently order and sort the values of a field.
Alternatively you can do the same with Qlik expressions for Sense sources in a regular filter above.


Size and position

You can quickly drag, drop, resize, and order your elements on the report. However, for further precision, the system also offers absolute control over sizing and positioning using numeric values to easily create pixel-perfect reports.

Note
All size and position measurements are calculated in the Report Unit specified in the Report Settings (default is mm).

When sizing and positioning elements using mouse drag operations, you will also see design guides (shown as green lines on the image) to help you with correct placement.

For Text elements, you have the following options available:

Position

You can specify the text element position by specifying its distance from the white space on the designer sheet. The position settings specified here are calculated in addition to the Page Margin specified in the Page Settings.

For example, if you have specified the page margin as 5 mm, and the left margin as 15 mm, then the text element would be placed at 20 mm from the left edge of the page, as shown in the image. 

  • Top: Specifies the distance of the element from the top page margin. The element is placed at a distance of page margin value + Top value from the edge of the report page.
  • Fixed: Enable this option to fix the position of the element on the sheet. In this case, the position of the element remains fixed on the page and will not move according to the size or position of the element above it.
    NOTE: This is applicable only to the top position of the element, as it can only be impacted by elements (typically, a table) above, which would shift the element further down (as tables are the only elements that have no predictable height). It has no impact on the horizontal position. 
The Fixed option is not the same as the Lock provided on the Toolbar.
  • Fixed prevents automated shifting (by export generation)
  • Locked prevents manual shifting (by user operations)
  • Left: Specifies the distance of the element from the left margin of the page. The element is placed at a distance of page margin value + Left value from the edge of the report page.

NOTE: If you have enabled Header on the Page Settings and your element touches inside the header area, it will be repeated on each report page.



Size
  • Width:  Specifies the width of the element on the page. Depending on the Linebreak setting, altering the width might have an impact on the height of the object, as the text content may grow down. 
  • Overflow: Specify how the text content is rendered in case it overflows the text element width.
    Choose from any of the following:
    • No Linebreak: The overflow is clipped, and an ellipsis ("...") is rendered to represent the clipped text.
    • Linebreak by word: Acts like a word wrap and inserts a line break at a word every time the text string would overflow the cell.
    • Linebreak by character: Acts like a word wrap and inserts a line break at any character from the text string that would overflow the cell. It is particularly useful for Chinese, Japanese, Korean, or other such languages that have character typeface.

NOTE: The text element can only have a width, but not a specific height. If the No Linebreak option is selected, the text element will be as high as the one line of text (depending on the font size). For Line break, the text element will be as high as the content will fill it. Only static content is predictable, e.g. a title or a header.
Dynamic Text element content with line-break also shifts the elements below, like table objects (but texts don't span over pages).

The images show how the line break works to adjust the text within the element width.

Note
Text elements with dynamic overflowing content shift elements placed below them further below when they grow.
You can enable the Fixed position for the below elements to prevent that.
Rotation

Specifies the angular placement of the element on the report page.



No Linebreak:


Linebreak by word:


Linebreak by character:

Appearance

As the name suggests, the Appearance settings allow you to define how the text elements look.

  • Background color specifies the fill color of the Text element.
    Use the X icon to remove the background color. In this case, it can be placed upon other elements and show a transparent background.
  • Opacity sets the transparency level for the text element in percentage. This means, a value set as 0 is fully transparent and 100 fully opaque. Opacity applies to the whole element, including the text itself and border.
  • Border color and Width set the outline for the element. It does not add to the size of the element as it grows towards the inside.
    Set the border width to 0 to not show any border lines.
  • Padding forms an inwards distance of text element content from the element boundary and applies to all sides of the element.

Font

Click the Font tab to specify the font properties of the text element.

  • Font: Select one of the typeface options from the list.
  • Font Size: Specify the font size (in points) for text content.
  • Font Color: Use the color picker or provide a HEX code to set the font color.
  • Font Style: Use the toggle buttons to add the style options Bold, Italic, or Underline.

Please note, the font settings apply to the whole text element. To define specific font styles for different content types, add separate text elements for each type.

Here's a sample report with different styles for header, date, and content.

Barcode

ancoreShare Server supports most of the standard barcode types. If you select the Barcode option from the Font list, the visual font in the element on the designer page turns to monospace (to indicate the barcode mode).

The width of the barcode image is still determined by the width you set for the element and not by content. So, the Overflow setting in Size and position has no effect.
Consider that in case the lines get too dense (it might get hard to read for barcode scanners).
You can control the height of the barcode with the Font size.

The image on right shows a sample report with a barcode font.

When working with barcodes, it's recommended to test the generated code with a scanner to ensure it can be read properly. Some scanners require the code to follow a certain width and height, so you may have to adjust the element accordingly.

You can use barcodes both in the content and title area.


Note

You can add notes to your text elements to provide additional information to your users on the export, when generating in PDF or PPTX format.

For example, you can add notes for commenting on something, drawing attention to a specific area in the report, taking a note for yourself, giving some context for colleagues, adding information that is not in the text, and so on.

To add a note:

  1. Specify the Title (optional) and your Note in the corresponding fields.
  2. You can also specify the Position of the note with respect to the element.
    Select the position from the four available options: top-left, top-right, bottom-left, and bottom-right.

If you generate a PDF export, then the notes are exported as actual annotations in the PDF file. Users with sufficient privileges can further edit them too, which enables active collaboration.

In the case of PPTX exports, the notes are shown in the Notes area at the bottom of each slide. As the PPTX does not show notes on elements, all the notes are shown collectively at the bottom of each page/slide. It is recommended to use Titles for notes to segregate them for each element.





Next Steps:




Was this article helpful?