A small thing we did for our client
This is one of the posts from the how-we-do-it series.
A while ago we had a part of a project where our client NSN ASA wanted to have:
- Custom reporting with an advanced mail merge function (to create invoices, order lists, etc.)
- Easy-to-create report templates, so they can be created by non-programmers
- Simple, simple, simple
- PHP API
Our first thought of course was to find an appropriate component and use it for this project. However, we were amazed to realize there isn’t any out-of-box solution for easy report creation from PHP. There surely are a lot of ready solutions like CrystalReports, Birt, Jasper reports with iReport, but we felt none of them met the above requirements (especially simplicity).
So, here is our approach to solving this problem:
- Report data should be sent via a standardized XML. There will be no more than hands full types of XML tags in the report data.
- Report template will be created with MS Word (after all, anyone can use it, right?)
- Template will have the simplest possible tagging system, implemented as MS WORD fields. (Example: <<tablestart>><<data1>><<data2>><<data3>><<tableend>>
- There are no good Unix components for handling Word files – therefore we will implement this on windows platform and expose SOAP interface for accessing it from PHP.
Now that this is up and running here is the small illustration of our “baby” in action:
We would like to thank NSN ASA for giving us the green light to share this with you.

