{"id":266,"date":"2009-11-03T01:18:47","date_gmt":"2009-11-03T00:18:47","guid":{"rendered":"http:\/\/pocoproject.org\/blog\/?p=266"},"modified":"2009-11-03T02:19:35","modified_gmt":"2009-11-03T01:19:35","slug":"poco-json-extjs-pdf-and-rowformatter","status":"publish","type":"post","link":"https:\/\/pocoproject.org\/blog\/?p=266","title":{"rendered":"POCO, JSON, ExtJS, PDF and RowFormatter"},"content":{"rendered":"<p>If anyone wonders what are those recent <a href=\"http:\/\/poco.svn.sourceforge.net\/viewvc\/poco\/sandbox\/\">sandbox<\/a> commits about, I&#8217;ve been working on some reports recently and opted to use <a href=\"http:\/\/www.extjs.com\/\">ExtJS<\/a> in conjunction with the <a href=\"http:\/\/poco.svn.sourceforge.net\/viewvc\/poco\/sandbox\/\">sandbox<\/a> <a href=\"http:\/\/poco.svn.sourceforge.net\/viewvc\/poco\/sandbox\/Web\/\">JSON<\/a> and <a href=\"http:\/\/poco.svn.sourceforge.net\/viewvc\/poco\/sandbox\/PDF\/\">PDF<\/a> libraries.<\/p>\n<p>Well, the verdict is that those two sandbox libs are actually quite stable and usable. JSON even comes with <a href=\"http:\/\/www.extjs.com\/\">ExtJS<\/a> remoting (a.k.a. <a href=\"http:\/\/www.extjs.com\/products\/extjs\/direct.php\">Ext.Direct<\/a>) <a href=\"http:\/\/poco.svn.sourceforge.net\/viewvc\/poco\/sandbox\/Web\/include\/Poco\/Web\/ExtJS\/\">support<\/a>. Using <a href=\"http:\/\/poco.svn.sourceforge.net\/viewvc\/poco\/sandbox\/PDF\/\">Poco::PDF<\/a> library, I was able to code a PDFFormater (a <a href=\"http:\/\/poco.svn.sourceforge.net\/viewvc\/poco\/poco\/trunk\/Data\/include\/Poco\/Data\/RowFormatter.h?view=markup\">RowFormatter<\/a> child class which plugs into the <a href=\"http:\/\/poco.svn.sourceforge.net\/viewvc\/poco\/poco\/trunk\/Data\/include\/Poco\/Data\/RecordSet.h?view=markup\">RecordSet<\/a> to chew on SQL and spit out a PDF) in a matter of hours. And it&#8217;s amazingly fast &#8211; a 100+ pages document pops up within few seconds*.<\/p>\n<p>The main <a href=\"http:\/\/poco.svn.sourceforge.net\/viewvc\/poco\/poco\/trunk\/Data\/include\/Poco\/Data\/RowFormatter.h?r1=1262&amp;r2=1267\">change<\/a> to the <a href=\"http:\/\/poco.svn.sourceforge.net\/viewvc\/poco\/poco\/trunk\/Data\/include\/Poco\/Data\/RowFormatter.h?view=markup\">RowFormater<\/a> is that it has two modes now &#8211; 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).<\/p>\n<p>* The timing includes querying, populating recordset, generating PDF and streaming it over HTTP (on localhost, although database is on a different machine)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If anyone wonders what are those recent sandbox commits about, I&#8217;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. [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-266","post","type-post","status-publish","format-standard","hentry","category-news"],"_links":{"self":[{"href":"https:\/\/pocoproject.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/266","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pocoproject.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pocoproject.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pocoproject.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/pocoproject.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=266"}],"version-history":[{"count":23,"href":"https:\/\/pocoproject.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/266\/revisions"}],"predecessor-version":[{"id":285,"href":"https:\/\/pocoproject.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/266\/revisions\/285"}],"wp:attachment":[{"href":"https:\/\/pocoproject.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=266"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pocoproject.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=266"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pocoproject.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=266"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}