Need something like a "Vertical Tab" to position text at the bottom of the last page (PDF)
<em><span style="font-size:large;">[font="cambria;"]Use Case[/font]</span></em><p><span style="font-size:large;">[font="cambria;"]<span style="font-size:medium;">[font="calibri;"]I have an invoice report with several pages. Some dynamic text items should be displayed near the bottom of the last page.[/font][/font]</span></span></p><p><span style="font-size:large;">[font="cambria;"] [/font]</span></p><p><span style="font-size:large;">[font="cambria;"]<strong><span style="font-size:medium;">[font="calibri;"]<span style="font-size:large;">[font="cambria;"]<em>Obviously no solution available</em>[/font][/font][/font]</span></strong></span></span></p><p><span style="font-size:large;">[font="cambria;"]<span style="font-size:medium;">[font="calibri;"]I am aware that for simple reports with fixed row height in a table, it is possible to count the rows, estimate the space used by the table, and add another table with just enough rows between the invoice positions table and the dynamic text. However, this only works if the row height is fixed and if I know where the table starts on the page.[/font][/font]</span></span></p><p><span style="font-size:large;">[font="cambria;"]<span style="font-size:medium;">[font="calibri;"]Unfortunately, this is not the case in my reports, as their is dynamic text (several lines) before the table and the descriptive text in the rows may wrap.[/font][/font]</span></span></p><p><span style="font-size:large;">[font="cambria;"] [/font]</span></p><p><span style="font-size:large;">[font="cambria;"]<span style="font-size:medium;">[font="calibri;"]There is a very old known bug that this does not work with BIRT.[/font][/font]</span></span></p><p><span style="font-size:large;">[font="cambria;"] [/font]</span></p><p><span style="font-size:large;">[font="cambria;"]<span style="font-size:medium;">[font="calibri;"]One idea that came to my mind was to use the Footer of the MasterPage.[/font][/font]</span></span></p><p><span style="font-size:large;">[font="cambria;"]<span style="font-size:medium;">[font="calibri;"]However, it is only possible to hide the footer on the last page, but not to show it <em>only </em>on the last page.[/font][/font]</span></span></p><p><span style="font-size:large;">[font="cambria;"]<span style="font-size:medium;">[font="calibri;"]Even if that worked, it had negative impact because the space for the footer would have been wasted on all pages except the last one.[/font][/font]</span></span></p><p><span style="font-size:large;">[font="cambria;"]<span style="font-size:medium;">[font="calibri;"]BTW it would be great if the visibility condition could be extended for every item inside the MasterPage for three different cases: first page, "inbetween" page, last page.[/font][/font]</span></span></p><p><span style="font-size:large;">[font="cambria;"]<span style="font-size:medium;">[font="calibri;"]And another great feature would be if the space for a non-displayed header or footer item (which is wasted at the moment) could be "returned" to the content (for the footer, items above the hidden items should "drop" down instead of the following items to go up).[/font][/font]</span></span></p><p><span style="font-size:large;">[font="cambria;"] [/font]</span></p><p><span style="font-size:large;">[font="cambria;"]<span style="font-size:medium;">[font="calibri;"]<strong><span style="font-size:medium;">[font="calibri;"]<span style="font-size:large;">[font="cambria;"]<em>Idea for "VerticalTab" item</em>[/font][/font][/font][/font]</strong></span></span></span></span></p><p><span style="font-size:medium;">[font="calibri;"]Having some experience with other tools like ReportLab, I wonder if its possible to create an Extended Item I call <em>VerticalTab</em> that works as follows (with ReportLab, that would be a snap...):[/font]</span></p><ul class='bbc'><li><span style="font-size:medium;">[font="calibri;"]It has only an effect when using <em>FixedLayout </em>mode (e.g. multi-page PDF).[/font]</span></li><li><span style="font-size:medium;">[font="calibri;"]There is only one property:<span style="font-size:medium;">[font="calibri;"] <em>distanceToPageBottom</em>. This property specified the distance to the bottom of the page (ignoring the page footer height and the page bottom margin, but that's not really important).[/font][/font]</span></span></li><li><span style="font-size:medium;">[font="calibri;"]The effect is as follows: When the Layout Engine executes this item, the item (or the layout engine) looks at the current y position and computes how many space is still available below. It then compares this value (let's call it <em>currentDTB</em>) to the specified <em>distanceToPageBottom</em>:[/font]</span></li><li><span style="font-size:medium;">[font="calibri;"]<em>currentDPB > distanceToPageBottom</em>: Set <em>y position </em>= <em>distanceToPageBottom</em>[/font]</span></li><li><span style="font-size:medium;">[font="calibri;"]<em>currentDPB = distanceToPageBottom</em>: nichts tun[/font]</span></li><li><span style="font-size:medium;">[font="calibri;"]<em>currentDPB < distanceToPageBottom</em>: force a page break[/font]</span></li></ul>
<p><span style="font-size:medium;">[font="calibri;"]In other words, assure that the next item will start exactly at the specified <em>distanceToPageBottom.</em> [/font]</span></p><p><span style="font-size:medium;">[font="calibri;"]The last case is special: If there's not enough space left on the current page, force a page break and render the VerticalTab again there - such that the next item stands alone at the bottom of the last page...[/font]</span></p><p> </p><p><span style="font-size:medium;">[font="calibri;"]This would be easy to do if the item could see the current y position during its size computation.[/font]</span></p><p><span style="font-size:medium;">[font="calibri;"]In Reportlab, this is the case (there, the central method "wrap" has availH and availW arguments).[/font]</span></p><p> </p><p><span style="font-size:medium;">[font="calibri;"]It might also work if the item could tell it has a height 0 when it is created, but during the actual rendering process it would increase the current y position as needed.[/font]</span></p><p> </p><p><span style="font-size:medium;">[font="calibri;"]After studying the BIRT code and the RotatedText plugin, I have to admit that I just don't undestand how the layout engine is actually working. It seems quite complex.[/font]</span></p><p> </p><p><span style="font-size:medium;">[font="calibri;"]I didn't find any other Extended Item example except those in the BIRT controls lib, which are all bitmap-image-based.[/font]</span></p><p><span style="font-size:medium;">[font="calibri;"]My gut feeling tells me that the following source files are important here:[/font]</span></p><p><span style="font-size:medium;">[font="calibri;"]<span style="font-size:11pt;">[font="calibri, sans-serif;"]orgeclipsebirtreportenginelayoutemitterPageDeviceRender.java, method [/font][/font]</span></span><span style="font-size:medium;">[font="calibri;"]<span style="font-size:11pt;">[font="calibri, sans-serif;"]getActualPageBodyHeight[/font][/font]</span></span></p><p><span style="font-size:medium;">[font="calibri;"]Package <span style="font-size:11pt;">[font="calibri, sans-serif;"]org.eclipse.birt.report.enginesrcorgeclipsebirtreportenginenLayoutareaimpl, with the classes AbstractArea, ContainerArea, PageArea and so on.[/font][/font]</span></span></p><p> </p><p><strong><span style="font-size:medium;">[font="calibri;"]<span style="font-size:11pt;">[font="calibri, sans-serif;"]But I just dont know how to start. [/font][/font]</span></span></strong><strong><span style="font-size:medium;">[font="calibri;"]<span style="font-size:11pt;">[font="calibri, sans-serif;"]Any hints or pointers?[/font][/font]</span></span></strong></p><p> </p><p> </p>