<?xml version="1.0"?>
<rss version="2.0">
<channel>
  <title>Reporting Tales - bug tag</title>
  <link>http://www.sherito.org/tags/bug/</link>
  <description>.. if it is not printed, it can&#039;t be real</description>
  <language>en</language>
  <copyright>Thomas Morgner</copyright>
  <lastBuildDate>Tue, 26 Aug 2008 11:33:00 GMT</lastBuildDate>
  <generator>Pebble (http://pebble.sourceforge.net)</generator>
  <docs>http://backend.userland.com/rss</docs>
  
  
  <item>
    <title>Pagination kills me</title>
    <link>http://www.sherito.org/2007/04/11/1176305760000.html</link>
    
      
        <description>
          &lt;p align=&#034;justify&#034;&gt;Not that pagination is overly complicated. Pagination is a simple process that involves shifting a couple of boxes downward whenever that box crosses a pagebreak.&lt;/p&gt;
&lt;p align=&#034;justify&#034;&gt;The whole content is already laid out (ignoring all breaks so far) and now all I have to do is the simple shifting. But I cant. It involves logic and mathematics (addition, subtraction, nothing else). Logic and maths trigger something deep inside me - and a simple task becomes a living nightmare.&lt;/p&gt;
&lt;p align=&#034;justify&#034;&gt;Now I&#039;m really glad that LibLayout&#039;s rendering follows such a strict separation of concerns. At least I can be sure that the common layouting works. This really makes it easy to locate the place where things go wrong.&lt;/p&gt;
&lt;p align=&#034;justify&#034;&gt;Ahh, sooner or later, after long nights of coding, this thing will start to work. If everything fails, I can still resort to the more approach and start to summon a daemon or two to help me on that. They still owe me a favor for the &lt;a href=&#034;http://jfreereport.sourceforge.net/extreport-085.dtd&#034;&gt;&#039;extended-XML&#039; format&lt;/a&gt;. This one most certainly caused more cursing than any rush-hour traffic-jams on the A5 in Frankfurt.&lt;/p&gt;
        </description>
      
      
    
    
    
    <comments>http://www.sherito.org/2007/04/11/1176305760000.html#comments</comments>
    <guid isPermaLink="true">http://www.sherito.org/2007/04/11/1176305760000.html</guid>
    <pubDate>Wed, 11 Apr 2007 15:36:00 GMT</pubDate>
  </item>
  
  <item>
    <title>Sometimes things are just mess up ..</title>
    <link>http://www.sherito.org/2007/04/02/1175519940000.html</link>
    
      
        <description>
          &lt;p align=&#034;justify&#034;&gt; If you download any of the 0.8.8 versions of Pentaho Reporting Classic, you will notice one thing: The last page-footer does contain any values. It contains labels, but it never displays function results or other data-items. &lt;/p&gt;
&lt;div align=&#034;justify&#034;&gt; &lt;/div&gt;
&lt;p align=&#034;justify&#034;&gt; After this bug survived undected for three month (or maybe simply no one cared for filing a bug-report), I finally received notice of this bug&#039;s existence. Five minutes of debugging later, I got that very ugly feeling. No, this was not a simple bug - it came directly from the 7th circle of hell: A logic bug. &lt;/p&gt;
&lt;div align=&#034;justify&#034;&gt; &lt;/div&gt;
&lt;p align=&#034;justify&#034;&gt; When we introduced sub-reporting into the engine, we also had to change the datasource management of the reporting engine. In the old days, there was not much of a datasource management. Everything was static - when the report started we knew exactly what columns would be available, and that number would never change. Oh, life was beautiful and simple. &lt;/p&gt;
&lt;div align=&#034;justify&#034;&gt; &lt;/div&gt;
&lt;p align=&#034;justify&#034;&gt; But then came the subreporting and everything changed. Subreports introduce their own datasources and an own set of functions. Suddenly the simplicity was gone forever - and would never come back again. &lt;/p&gt;
&lt;div align=&#034;justify&#034;&gt; &lt;/div&gt;
&lt;p align=&#034;justify&#034;&gt; As the Flow-Engine already handles such dynamic datasources already (and I really, really hate to maintain two independent implementation for the same problem), we simply grabbed the datasource-code from that branch and ported it to the classic engine. On the positive side, it gave us the whole datasources and query-management features of the flow engine along with the very flexible parameter-passing mechanism. But we had to pay a price: We now have to maintain a data-context so that we know when to add and to remove columns from the datasource.  &lt;/p&gt;
&lt;div align=&#034;justify&#034;&gt; &lt;/div&gt;
&lt;p align=&#034;justify&#034;&gt; As the classic engine is very simple, so is the context management. There is only one context at all, and that&#039;s the report or subreport. &lt;/p&gt;
&lt;div align=&#034;justify&#034;&gt; &lt;/div&gt;
&lt;p align=&#034;justify&#034;&gt; It could have worked out so nice. &lt;/p&gt;
&lt;div align=&#034;justify&#034;&gt; &lt;/div&gt;
&lt;p align=&#034;justify&#034;&gt; The page-footer is not printed, until the system detects that the page is filled. As &lt;a href=&#034;http://www.sherito.org/2007/03/11/1173642720000.html&#034;&gt;outlined before&lt;/a&gt;, although we layout the page-footer all the time, we do not copy it to the final page until the end of the page has been reached. This actual copying is done outside of the normal report processing. For the last page, however, the report processing has already been finished. The current context is closed and everyone is waiting for the garbage-collector. And at this point, printing the page-footer fails.  &lt;/p&gt;
&lt;div align=&#034;justify&#034;&gt; &lt;/div&gt;
&lt;p align=&#034;justify&#034;&gt; How to fix it: Ok, we could start tweaking and start adding workarounds until the system behaves as expected. We did it before, it surely produces a solution - somehow. An unmaintainable solution that eats souls like others eat cornflakes, a nightmare for those who have to maintain the beast and have to fix bugs there. &lt;/p&gt;
&lt;div align=&#034;justify&#034;&gt; &lt;/div&gt;
&lt;p align=&#034;justify&#034;&gt; As chances are good that I&#039;m the one who will be called for that, this patching is no solution. I&#039;m crazy, but not stupid. &lt;/p&gt;
&lt;div align=&#034;justify&#034;&gt; &lt;/div&gt;
&lt;p align=&#034;justify&#034;&gt; And here&#039;s my favourite approach: (1) Look at the flow-engine and how they deal with page-footer definitions. (2) Copy the solution. (3) Be happy. &lt;/p&gt;
&lt;div align=&#034;justify&#034;&gt; &lt;/div&gt;
&lt;p align=&#034;justify&#034;&gt; In the Flow engine, page-header and footer are defined together before the content is genereated. These footers are then pushed down to the layouter, where they get replicated on each new page. Whenever the header or footer changes, the engine simply replaces the stored template with a new one. (And if you look closer on it, then this approach is not that far away from the repeated layouting of the page-footer to compute the available space, as we did it in the classic engine.) The Classic-Engine even already has an storage layer between the report-engine&#039;s element definitions and the output targets content implemented. The &#039;MetaBands&#039; and the &#039;MetaPage&#039; classes currently serve as some kind of a spooling mechanism. It should not be too complicated to transform this into a real layouting layer. &lt;/p&gt;
&lt;div align=&#034;justify&#034;&gt; &lt;/div&gt;
&lt;p align=&#034;justify&#034;&gt; And yet another step on the long road to get both engines aligned. &lt;/p&gt;
        </description>
      
      
    
    
    
    <comments>http://www.sherito.org/2007/04/02/1175519940000.html#comments</comments>
    <guid isPermaLink="true">http://www.sherito.org/2007/04/02/1175519940000.html</guid>
    <pubDate>Mon, 02 Apr 2007 13:19:00 GMT</pubDate>
  </item>
  
  </channel>
</rss>
