Skip to main content

7.5.3 Capturing column view

Since column view is just an overlay over a buffer, it cannot be exported or printed directly. If you want to capture a column view, use a β€˜columnview’ dynamic block (see Dynamic Blocks). The frame of this block looks like this:

* The column view
#+BEGIN: columnview :hlines 1 :id "label"

#+END:

This dynamic block has the following parameters:

β€˜:id’​

This is the most important parameter. Column view is a feature that is often localized to a certain (sub)tree, and the capture block might be at a different location in the file. To identify the tree whose view to capture, you can use four values:

β€˜local’​

Use the tree in which the capture block is located.

β€˜global’​

Make a global view, including all headings in the file.

β€˜file:FILENAME’​

Run column view at the top of the FILENAME file.

β€˜LABEL’​

Call column view in the tree that has an β€˜ID’ property with the value LABEL. You can use M-x org-id-copy to create a globally unique ID for the current entry and copy it to the kill-ring.

β€˜:match’​

When set to a string, use this as a tags/property match filter to select only a subset of the headlines in the scope set by the :id parameter.

β€˜:hlines’​

When t, insert an hline after every line. When a number N, insert an hline before each headline with level <= N.

β€˜:vlines’​

When non-nil, force column groups to get vertical lines.

β€˜:maxlevel’​

When set to a number, do not capture entries below this level.

β€˜:skip-empty-rows’​

When non-nil, skip rows where the only non-empty specifier of the column view is β€˜ITEM’.

β€˜:exclude-tags’​

List of tags to exclude from column view table: entries with these tags will be excluded from the column view.

β€˜:indent’​

When non-nil, indent each β€˜ITEM’ field according to its level.

β€˜:format’​

Specify a column attribute (see Column attributes) for the dynamic block.

The following commands insert or update the dynamic block:

org-columns-insert-dblock​

Insert a dynamic block capturing a column view. Prompt for the scope or ID of the view.

This command can be invoked by calling org-dynamic-block-insert-dblock (C-c C-x x) and selecting β€œcolumnview" (see Dynamic Blocks).

C-c C-c C-c C-x C-u (org-dblock-update)​

Update dynamic block at point. point needs to be in the β€˜#+BEGIN’ line of the dynamic block.

C-u C-c C-x C-u (org-update-all-dblocks)​

Update all dynamic blocks (see Dynamic Blocks). This is useful if you have several clock table blocks, column-capturing blocks or other dynamic blocks in a buffer.

You can add formulas to the column view table and you may add plotting instructions in front of the tableβ€”these survive an update of the block. If there is a β€˜TBLFM’ keyword after the table, the table is recalculated automatically after an update.

An alternative way to capture and process property values into a table is provided by Eric Schulte’s β€˜org-collector.el’, which is a contributed package1. It provides a general API to collect properties from entries in a certain scope, and arbitrary Lisp expressions to process these values before inserting them into a table or a dynamic block.


  1. Contributed packages are not part of Emacs, but are distributed with the main distribution of Orgβ€”visit https://orgmode.org.↩