POCO, JSON, ExtJS, PDF and RowFormatter
If anyone wonders what are those recent sandbox commits about, I’ve been working on some reports recently and opted to use ExtJS in conjunction with the sandbox JSON and PDF libraries.
Well, the verdict is that those two sandbox libs are actually quite stable and usable. JSON even comes with ExtJS remoting (a.k.a. Ext.Direct) support. Using Poco::PDF library, I was able to code a PDFFormater (a RowFormatter child class which plugs into the RecordSet to chew on SQL and spit out a PDF) in a matter of hours. And it’s amazingly fast – a 100+ pages document pops up within few seconds*.
The main change to the RowFormater is that it has two modes now – progressive and bulk. Progressive is for formats that can be easily streamed in chunks, as recordset rows are generated (such as HTML, XML, JSON etc). Bulk is used where it makes more sense to generate the whole formatted output before streaming it (e.g. PDF).
* The timing includes querying, populating recordset, generating PDF and streaming it over HTTP (on localhost, although database is on a different machine)