19.2.7. Das Tabellenelement

You can use table items to decorate and explain your map:

  • Attribute table: shows a subset of the attributes of a layer, based on predefined rules

  • Fixed table: inserts a manual text table where information can be independent from the layers.

19.2.7.1. Das Attributtabellenelement

Any layer in the project can have its attributes shown in the print layout. Use the Tabelle hinzufügen Add Attribute Table tool following items creation instructions to add a new table item that you can later manipulate the same way as exposed in Interacting with layout items.

By default, a new attribute table item loads first rows of the first (alphabetically sorted) layer, with all the fields. You can however customize the table thanks to its Item Properties panel. Other than the items common properties, this feature has the following functionalities (see Abb. 19.38):

../../../../_images/attribute_properties.png

Abb. 19.38 Attribute table Item Properties Panel

Haupteigenschaften

The Main properties group of the attribute table provides the following functionalities (see Abb. 19.39):

../../../../_images/attribute_mainproperties.png

Abb. 19.39 Attribute table Main properties Group

  • For Source you can by default only select Layer features allowing you to select a Layer from the vector layers loaded in the project.

    The dataDefine Data-defined override button near the layer list allows you to dynamically change the layer which is used to populate the table, e.g. you could fill the attribute table with different layer attributes per atlas page. Note that the table structure used (Abb. 19.42) is the one of the layer shown in the Layer drop-down list and it is left intact, meaning that setting a data defined table to a layer with different field(s) will result in empty column(s) in the table.

    In case you activate the KontrollkästchenGenerate an atlas option in the Atlas panel (see Einen Atlas erzeugen), there are two additional Source possible:

    • Current atlas feature (see Abb. 19.40): you won’t see any option to choose the layer, and the table item will only show a row with the attributes from the current feature of the atlas coverage layer.

    • and Relation children (see Abb. 19.41): an option with the relation names will show up. This feature can only be used if you have defined a relation using your atlas coverage layer as parent, and the table will show the children rows of the atlas coverage layer’s current feature.

  • The button Refresh Table Data can be used to refresh the table when the actual contents of the table has changed.

../../../../_images/attribute_mainatlas.png

Abb. 19.40 Attribute table Main properties for ‚Current atlas feature‘

../../../../_images/attribute_mainrelation.png

Abb. 19.41 Attribute table Main properties for ‚Relation children‘

  • The button Attributes… starts the Select Attributes dialog, (see Abb. 19.42) that can be used to change the visible contents of the table. The upper part of the window shows the list of the attributes to display and the lower part helps you sort the data.

    ../../../../_images/attribute_select.png

    Abb. 19.42 Attribute table Select attributes Dialog

    Im Spalten Abschnitt können Sie:

    • Move attributes up or down the list by selecting the rows and then using the arrowUp and arrowDown buttons to shift the rows. Multiple rows can be selected and moved at any one time.

    • Add an attribute with the symbologyAdd button. This will add an empty row at the bottom of the table where you can select a field to be the attribute value or create an attribute via a regular expression.

    • Remove an attribute with the symbologyRemove button. Multiple rows can be selected and removed at any one time.

    • Reset the attribute table back to its default state with the Reset button.

    • Clear the table using the Clear button. This is useful when you have a large table but only want to show a small number of attributes. Instead of manually removing each row, it may be quicker to clear the table and add the rows needed.

    • Cell headings can be altered by adding the custom text in the Heading column.

    • Cell alignment can be managed with the Alignment column which will dictate the texts position within the table cell.

    • Cell width can be manually managed by adding custom values to the width column.

    Im Sortierung Abschnitt können Sie:

    • Add an attribute to sort the table with: press the symbologyAdd button and a new empty row is added. Insert a field or an expression in the Attribute column and set the Sort order to Ascending or Descending.

    • Select a row in the list and use the arrowUp and arrowDown buttons to change the sort priority on attribute level. Selecting a cell in the Sort Order column helps you change the sorting order of the attribute field.

    • Use the symbologyRemove button to remove an attribute from the sorting list.

Objektfiltrierung

The Feature filtering group of the attribute table provides the following functionalities (see Abb. 19.43):

../../../../_images/attribute_filter.png

Abb. 19.43 Attribute table Feature filtering Group

Sie können:

  • Die Maximalen Zeilen , die dargestellt werden sollen, definieren.

  • Kontrollkästchen Doppelte Zeilen aus der Tabelle entfernen aktivieren um nur eindeutige Datensätze zu zeigen.

  • Activate Kontrollkästchen Show only visible features within a map and select the corresponding Linked map whose visible features attributes will be displayed.

  • Activate Kontrollkästchen Show only features intersecting Atlas feature is only available when Kontrollkästchen Generate an atlas is activated. When activated it will show a table with only the features which intersect the current atlas feature.

  • Aktivieren Sie Kontrollkästchen Filtern nach und schaffen Sie einen Filter indem Sie eine Eingabezeile eingeben oder einen regulären Ausdruck über den gegebenen Ausdrucksknopf einfügen. Einige Beispiele von Filteranweisungen, die Sie verwenden können wenn Sie den airports Layer aus dem Beispieldatensatz geladen haben

    • ELEV > 500

    • NAME = 'ANIAK'

    • NAME NOT LIKE 'AN%'

    • regexp_match( attribute( $currentfeature, 'USE' ) , '[i]')

    Der letzte reguläre Ausdruck wird nur die Flughäfen einfügen die einen Buchstaben ‚i‘ in der Attributspalte ‚USE‘ haben.

Darstellung

The Appearance group of the attribute table provides the following functionalities (see Abb. 19.44):

../../../../_images/attribute_appearance.png

Abb. 19.44 Attribute table appearance Group

  • Klicken Sie Kontrollkästchen Zeige leere Zeilen um die Attributtabelle mit leeren Zellen zu füllen, diese Option kann auch verwendet werden um zusätzliche leere Zellen zu schaffen, wenn Sie ein Ergebnis anzeigen wollen!

  • Mit Zellenränder können Sie die Ränder um den Text in jeder Zelle der Tabelle definieren.

  • Mit Kopf anzeigen können Sie von einer Liste eine der voreingestellten Optionen ‚Im ersten Rahmen‘, ‚In allen Rahmen‘ oder ‚Kein Kopf‘ auswählen.

  • Die Option Leere Tabellen kontrolliert was dargestellt wird wenn die Ergebnisauswahl leer ist.

    • Nur Kopf zeichnen zeichnet nur den Kopf ausser Sie haben ‚Kein Kopf‘ bei Kopf anzeigen ausgewählt.

    • Ganze Tabelle ausblenden zeichnet nur den Hintergrund der Tabelle. Sie können Kontrollkästchen Hintergrund nicht anzeigen wenn Rahmen leer ist in Rahmen aktivieren um die Tabelle komplett auszublenden.

    • Eingestellte Nachricht anzeigen zeichnet den Kopf und fügt eine Zelle ein, die sich über alle Spalten erstreckt und eine Nachricht wie ‚Kein Ergebnis‘ kann in der Option Anzuzeigende Nachricht bereitgestellt werden

  • Die Option Anzuzeigende Nachricht ist nur aktiviert wenn Sie Eingestellte Nachricht anzeigen bei Leere Tabelle gewählt haben. Die angegebene Nachricht wird in der Tabelle in der ersten Zeile gezeigt wenn das Ergebnis eine leere Tabelle ist.

  • With Background color you can set the background color of the table using the color selector widget. The Advanced customization option helps you define different background colors for each cell (see Abb. 19.45)

../../../../_images/attribute_background.png

Abb. 19.45 Attribute table Advanced Background Dialog

  • Kontrollkästchen Apply layer conditional styling colors: the conditional table formatting present in the layer is applied inside the layout attribute table (only background and foreground colors are currently supported). Conditional formatting rules take precedence over other layout table formatting settings, e.g. they will override other cell background color settings such as alternating row colors.

  • Mit der :gui-Label:`Wrap Text on` Option können Sie ein Zeichen definieren, auf dem der Zellinhalt wird eingewickelt wird, jedes Mal, wenn er erfüllt ist

  • With Oversized text you define the behavior when the width set for a column is smaller than its content’s length. It can be Wrap text or Truncate text.

Bemerkung

More properties of the attribute table item are described in the Tables common functionalities section.

19.2.7.2. Das Feste Tabellenelement

Additional information about the map can be inserted manually into a table by choosing Manuelle Tabelle hinzufügen Add Fixed Table and by following items creation instructions to add a new table item that you can later manipulate the same way as exposed in Interacting with layout items.

By default, an empty table with two minimized columns and rows appears in the map layout. You have to customize the table in the Item Properties panel. Other than the items common properties, this feature has the following functionalities:

Haupteigenschaften

../../../../_images/fixedtable_table_designer.png

Abb. 19.46 Fixed table Item Properties Panel with Table designer

In Main properties you can work with the Table designer when clicking the Edit table …:

  • You can click into the table and insert texts manually.

  • Through the menus on top it is possible to:

    • Import Content From Clipboard by going to File (it overrides given inputs).

    • work with selection functionalities for rows and columns by going to Edit.

    • Insert rows, Insert columns, Delete Rows, Delete Columns as well as using the option to Kontrollkästchen Include Header Row.

  • You can work with the Cell Contents section on the right and:

    • Define the text format of selected cells in Formatting

      • by clicking on the given expression expression button and using a regular expression for the input of the cell

      • by choosing the Text format

      • by Kontrollkästchen Format as number (several formats are available)

      • by defining the Horizontal alignment and the Vertical alignment

      • by choosing a Background color

    • Define the Cell Size with Row height and Column width.

Darstellung

The Appearance group of the fixed table provides the following functionalities:

  • Click Kontrollkästchen Show empty rows to fill the attribute table with empty cells.

  • Mit Zellenränder können Sie die Ränder um den Text in jeder Zelle der Tabelle definieren.

  • Mit Kopf anzeigen können Sie von einer Liste eine der voreingestellten Optionen ‚Im ersten Rahmen‘, ‚In allen Rahmen‘ oder ‚Kein Kopf‘ auswählen.

  • With Background color you can set the background color of the table using the color selector widget. The Advanced customization option helps you define different background colors for each cell.

  • With Oversized text you define the behavior when the width set for a column is smaller than its content’s length. It can be Wrap text or Truncate text.

Bemerkung

More properties of the fixed table item are described in the Tables common functionalities section.

19.2.7.3. Tables common functionalities

Gitter anzeigen

The Show grid group of the table items provides the following functionalities (see Abb. 19.47):

../../../../_images/attribute_grid.png

Abb. 19.47 Attribute table Show grid Group

  • Activate Kontrollkästchen Show grid when you want to display the grid, the outlines of the table cells. You can also select to either Draw horizontal lines or Draw vertical lines or both.

  • Mit Strichbreite können Sie die Dicke der Linien, die im Gitter verwendet werden, festlegen.

  • The Color of the grid can be set using the color selection widget.

Schrift- und Textgestaltung

The Fonts and text styling group of the table items provides the following functionalities (see Abb. 19.48):

../../../../_images/attribute_fonts.png

Abb. 19.48 Attribute table Fonts and text styling Group

  • You can define Font properties for Table heading and Table contents, using the advanced text settings widget (with buffer, shadow, paint effects, transparence, background, coloring, …). Note that these changes do not affect the cells that have custom font assigned, either from the Appearance section or the Table Designer dialog. Only cells with the default rendering are overwritten.

  • For Table heading you can additionally set the Alignment to Follow column alignment or override this setting by choosing Left, Center or Right. The column alignment is set using the Select Attributes dialog (see Abb. 19.42 ).

Rahmen

The Frames group of the table item properties provides the following functionalities (see Abb. 19.49):

../../../../_images/attribute_frame.png

Abb. 19.49 Attribute table Frames Group

  • Mit dem Größenmodus können Sie auswählen wie der Inhalt der Attributtabelle gerendert wird:

    • Use existing frames displays the result in the first frame and added frames only.

    • Extend to next page will create as many frames (and corresponding pages) as necessary to display the full selection of attribute table. Each frame can be moved around on the layout. If you resize a frame, the resulting table will be divided up between the other frames. The last frame will be trimmed to fit the table.

    • Repeat until finished will also create as many frames as the Extend to next page option, except all frames will have the same size.

  • Use the Add Frame button to add another frame with the same size as selected frame. The result of the table that will not fit in the first frame will continue in the next frame when you use the Resize mode Use existing frames.

  • Activate Kontrollkästchen Don’t export page if frame is empty prevents the page to be exported when the table frame has no contents. This means all other layout items, maps, scalebars, legends etc. will not be visible in the result.

  • Das Aktivieren von Kontrollkästchen Hintergrund nicht anzeigen wenn Rahmen leer ist verhindert dass der Hintergrund gezeichnet wird wenn der Rahmen keinen Inhalt hat.