17.2.7. 属性テーブルアイテム

Any layer in the project can have its attributes shown in the print layout. You can use this to decorate and explain your map with information about underlying data. Use the addTable Add Attribute Table tool following items creation instructions to add a new map 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 figure_layout_table):

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

図 17.36 属性テーブル項目のプロパティパネル

17.2.7.1. メインプロパティ

The Main properties group of the attribute table provides the following functionalities (see figure_layout_table_ppt):

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

図 17.37 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 dataDefined 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 (図 17.40) 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 checkboxGenerate an atlas option in the Atlas panel (see 地図帳を作成), there are two additional Source possible:

    • Current atlas feature (see figure_layout_table_atlas): 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 figure_layout_table_relation): 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

図 17.38 '現在の地図帳地物' の属性テーブルメインプロパティ

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

図 17.39 '関係の子' の属性テーブルメインプロパティ

  • The button Attributes... starts the Select Attributes dialog, (see figure_layout_table_select) 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

    図 17.40 属性テーブル 属性選択ダイアログ

    セクションでは:

    • 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 signPlus 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 signMinus 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.

    並べ替え セクションでは:

    • Add an attribute to sort the table with. Select an attribute and set the sorting order to Ascending or Descending and press the signPlus button. A new line is added to the sort order list.

    • 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 signMinus button to remove an attribute from the sort order list.

17.2.7.2. 地物フィルタリング

The Feature filtering group of the attribute table provides the following functionalities (see figure_layout_table_filter):

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

図 17.41 Attribute table Feature filtering Group

機能は:

  • 最大行数 で表示行を指定します.

  • checkbox テーブルから重複行を削除する をチェックすると, ユニークレコードのみ表示されます.

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

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

  • checkbox フィルタ ではフィルタ機能が提供されます。入力行に直接入力するか、 expression ボタンから通常の式を挿入します。サンプルデータセットから空港レイヤーをロードしたとき使用できるいくつかのフィルタ式の例があります:

    • ELEV > 500

    • NAME = 'ANIAK'

    • NAME NOT LIKE 'AN%'

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

    最後の式では、属性フィールド「USE」に文字「i」が含まれる空港だけを抽出しています。

17.2.7.3. 外観

The Appearance group of the attribute table provides the following functionalities (see figure_layout_table_appearance):

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

図 17.42 Attribute table appearance Group

  • checkbox 値が無い行の表示 をチェックすると属性テーブルが空のセルで埋められます. このオプションは結果表示に空白セルを追加するのにも使用できます.

  • セルマージン で, テーブルの各セルでテキストの周りのマージンを定義します.

  • ヘッダの表示 は, '最初のフレーム上', '全フレーム上' デフォルトオプション, または 'ヘッダなし' から選びます.

  • 値のないテーブル では, 選択結果が空となった場合の表示を制御します.

    • ヘッダーのみの描画 では, ヘッダーのみ描画します. ただし, ヘッダの表示 で 'ヘッダなし' を選んだ場合は除きます.

    • テーブル全体を隠す では, テーブルの背景のみ描画します. フレームcheckbox フレームの内容が無い場合は背景を描画しない をチェックすると, 完全にテーブルが隠れます.

    • 設定メッセージの表示 では、見出しを描画てすべての列にセルを追加し、 表示するメッセージ オプションに入力して '結果なし' のようなメッセージを表示できます。

  • 表示するメッセージ値の無いテーブル設定メッセージの表示 を選んだ場合のみ有効となります. ここで入力するメッセージは結果が空のテーブルになった場合の1行目に表示されます.

  • 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 figure_layout_table_background)

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

図 17.43 属性テーブル [高度な背景色]ダイアログ

  • テキストを折り返す オプションで、セルの内容を折り返すための文字を定義します。

  • 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.

17.2.7.4. グリッド表示

The Show grid group of the attribute table provides the following functionalities (see figure_layout_table_grid):

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

図 17.44 Attribute table Show grid Group

  • Activate checkbox 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.

  • 線幅 では, グリッドに使用する線の線幅を指定します.

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

17.2.7.5. フォントとテキストスタイリング

The Fonts and text styling group of the attribute table provides the following functionalities (see figure_layout_table_fonts):

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

図 17.45 Attribute table Fonts and text styling Group

  • You can define Font and Color for Table heading and Table contents, using font and color selector widgets.

  • 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 figure_layout_table_select ).

17.2.7.6. フレーム

The Frames group of the attribute table properties provides the following functionalities (see figure_layout_table_frames):

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

図 17.46 Attribute table Frames Group

  • リサイズモード で属性テーブルの内容をどのように表現するか選択できます:

    • 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 checkbox 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.

  • checkbox フレームの内容が無い場合は背景を描画しない をチェックすると, テーブルフレームに内容が無い場合に背景が描画されません.