Dive Table printing

Lutz Vieweg lvml at 5t9.de
Sun Aug 19 13:57:56 PDT 2012


As mentioned earlier, I used to use the Suunto SDM function to print a terse
dive table as a light-weight log when travelling, and I investigated how to
best do this with subsurface.

(BTW: I really like the nice looking dive-graphs that subsurface can already
print, but they would just take too much paper to print for a complete log book.)

Before coding anything, I wanted to find out what such a table could/should look
like, and experimented with a spread-sheet software (LibreOffice).
I realized that there are so many aspects that one could want to adjust according
to personal taste, that I wondered: Why re-implement all that fancy attribute selection,
page formatting, font-selection etc. stuff, when there is already plenty of
spread-sheet software which allows you to do right that with many more options
than I could ever be willing to re-implement?

Consequentialy, I tried what it takes to export the relevant dive information
from subsurface into spreadsheet software, and started by writing an xslt file
that would just produce a plain old CSV file - find it attached to this mail.

Using xsltproc (which is part of a package subsurface is already depending on),
  xsltproc subsurface/xslt/subsurface_to_csv.xslt your_dives.xml >your_dives.csv

Starting
  libreoffice your_dives.csv
you get a spread sheet that can be printed according to ones taste.

You can save your favourite formatting as a template (.ots) file, I've attached one
that fits my taste (and A4 paper).

Using such templates, alas, is not as easy as it should be for spread sheets,
use "Open ..." to open the .ots file as a second document, then "select all" from
the .csv file you loaded, then "Edit / Paste Special" in the .ots document,
deactivate the "insert all" button and the "Format" button (since you want to
retain the formatting of the .ots file), click OK then to have a spreadsheet
that is properly formatted for printing.

Ok, obviously, this is still a little cumbersome (but already good enough that I
could live with it).

More comfortable alternatives that come to mind:

* Write .csv files directly from subsurface
   Cons: - Just needs to be done (probably not too much effort).
         - Lazy users might not want to do any kind of formatting in another software

* Write an .xslt import filter for LibreOffice, so it can open subsurface XML files
   directly.
   Cons: - Requires more XSLT knowledge than I currently have
         - I am not sure this would easily allow to use a formatting of the users choice
         - Use limited to those who have LibreOffice installed

* Write .ods files from subsurface.
   Cons: - Is still specific to LibreOffice (and some may prefer Gnumeric or such?)
         - Significantly more effort

* Print tables directly from subsurface.
   Cons: - Will be either conforming to only the authors taste, or be an incredible
           amount of effort to do when aiming for flexibility.

What do you think?

Regards,

Lutz Vieweg

PS: You may of course re-distribute the attached files if you like
-------------- next part --------------
A non-text attachment was scrubbed...
Name: subsurface_to_csv.xslt
Type: application/xml
Size: 1435 bytes
Desc: not available
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20120819/b982b07f/attachment.wsdl>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dive_table.ots
Type: application/vnd.oasis.opendocument.spreadsheet-template
Size: 7751 bytes
Desc: not available
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20120819/b982b07f/attachment.ots>


More information about the subsurface mailing list