One of the features of our software is the ability to generate documents with information pre-filled on a per-case basis. Everything from name, address, fees, to… well, whatever we want can be stuffed into a document template and loaded into the system.
Basic documents are easy to do. The system is build that all you need is a template (mix of text and template-tags for data) and a name for the document to work. However, we sometimes need to do more fancy things like build document tables on the fly, leave fields open for editing, and make fields available as a drop-down list for the user to choose the option they want when printing.
That last feature is one I built. Give the code a list of items you want to show up in the selection box and away it goes, happy as can be.
I haven’t really thought about the that bit of code till today, when I was thinking about how to explain things to any new developers. How did I make that drop down code?  I created a document with a drop down, reverse engineered the generated document, then built code to create a dynamic dropdown.
I didn’t think much of it at the time, but looking back that does sound like a bit of code wizardry. That’s the sort of thing that I don’t do often but sure do enjoy when I get the chance.
That kind of code writing is probably best done in a room with a high ceiling. 🙂 It is fun when you do something a little or a lot harder and more creative than usual… wish you could do that more… Gives such a good feeling..