Exporting Clock Tables

After watching Jake B’s video on Org Clock Tables and Irreal’s commentary on it, The Emacs Cat decided to share how he uses clock tables. His use is very idiosyncratic and fashioned for his specific circumstances. The TL;DR is that his employer not only requires a periodic report of time spent on various tasks but requires a very specific format for the report that must be delivered in MS Word.

Putting aside, for the moment, the indignity of having to use Word, the stumbling block to simply using the Clock Table output is that requirement for a specific format. All the necessary data is there but in the wrong format.

It turns out that Org has the org-clock-get-table-data function that gathers the data for the Clock Table report and delivers it as an easily parsable list. Part of his employer’s specific format is that dates must be of the form DD.MM.YYYY and the times must be zero padded on the left and have different lengths depending on the context. Once he had raw data, it was easy to format appropriately and produce the required report. That leaves only delivering it as a Word doc. Of course, once more Emacs has us covered and he simply exported his results as an ODT file.

The other nice thing is that he did his development right in his time tracking Org file using source blocks. He was able to experiment with various approaches and see the data that org-clock-get-table-data returned. It’s a really nice post and serves as a how-to for anyone who needs to produce custom time reports.

This entry was posted in General and tagged , . Bookmark the permalink.