Usability - Productivity - Business - The web - Singapore & Twins

Extracting data from Domino into PDF using XSLT and XSL:FO (Part 1)

This entry is part of the series Domino, XSL:FO and XSLT that dives into the use of XSLT and XSL:FO in IBM Lotus Domino.

We all know " Notes doesn't print". Nevertheless the topic of document output and reports is not going away, even if I'd like to ban the reports. There are plenty of ready made tools, but today I'd like to start with home cooked reporting.
Why the effort? Using only tools that use open standards you gain more control over the whole process and you can use whatever deems fit. The downside: it is more things you need to know and might not be suitable for business users (but its great to torture interns). In the long run you have a portfolio of source transformations that you can combine potentially faster than any reporting tool. The general principle is "Extract Transform Render":
Extract Transform Render
  1. Extract:
    Whatever will pull out the XML for the second step will do the trick. For list type of rendering ?ReadViewEntries will do the trick or simple DXL exports. Quite often you might opt for some bespoke code to extract code with an eye of a fast and/or easy transformation phase. You also might consider to extract your data in conformance with an established international standard
  2. Transform:
    This step usually takes the XML from the extract phase and runs it through one or more XSLT transformations. XSLT is kind of IT Black Magic (other say it's just set theory) and can use quite some computing power. For high performance the pros use a dedicated applicance. Once you get the heck of XPath you can do some amazing reporting (e.g. "give me all sales guys where withing the last 5 sales of the 3 guys next to his ranking there was a carpenter")
  3. Render:
    Rendering is easy. The outcome of the transformation step will be XSL:FO which is a page description language. Use a free renderer or a commercial offering and a few lines of code. The output typically is a PDF file, but you can target graphic formats too.
Once you look at the bigger picture you will see that the approach works for other sources too. Using a set of XSLT transformations you can render data in various ways including charts (but that's a story for another time.
Extract Transform Render in a bigger context
Now the stage is set for more details - in future post. I will look at the code that is needed to have a render engine running (in XPages most likely, but the Notes client is tempting too), how XSL:FO looks like, some samples of data extraction and of course the magic of XSLT.
Read Part 2 and stay tuned!

Posted by on 2012-04-24 12:24 | Comments (3) | categories: Show-N-Tell Thursday XPages


  1. posted by Ursus on Tuesday 24 April 2012 AD - 15:59 Singapore Time:
    Thank you for this - I have been wanting to do it for some time now but as a Notes Classic type of guy didn't really know where to start (am currently using Word and COM to do all my printing which seems to be overkill). Am Looking forward to the rest of the posts :o)

    Keep up the good work Emoticon biggrin.gif
  2. posted by Jim Carey on Tuesday 24 April 2012 AD - 19:20 Singapore Time:
    { Link }

    via dxl exporter bad performance, works better via xpages/web?
  3. posted by Stephan H. Wissel on Tuesday 24 April 2012 AD - 21:58 Singapore Time:
    @Jim: when you export DXL you get "the full Monty" and that rendering takes time. For "I need this all the time" operations I rather advocate a SAX based generator that spits out the XML in a format closer to transformation ready.
    stw Emoticon biggrin.gif