Home
Designing Analytics Reports
pageNumber in Generation and Presentation tasks
Migrateduser
<p>Hi,</p>
<p>BIRT version 4.4.2, implemented by Workday. </p>
<p>The report engine is configured to separate the Generation and Presentation tasks.</p>
<p>The report has several tables that are NOT nested as we have 1 data set and 1 row of data. (XML data source) and each table has binding to the data set.</p>
<p>Table>Row>Cell>Grid>Row ectetc</p>
<p>Table>Row>Cell>Grid>Row ectect</p>
<p>It is using Auto Layout.</p>
<p>The output is PDF.</p>
<p>Based on different true/false criteria one or more tables are made visible and produce an emloyee contract and varous anexes to it.</p>
<p>The page brake parameter for each table for the anexes is set to before = “always†so the contract related annexes are always on new page. Some contracts and annexes span on more than 1 page.</p>
<p> </p>
<p>It all works ok but but for the the logo on the master page. It should appear on the 1<sup>st</sup> page of each table. For example if the contract has 3 pages it showld appear only on the 1<sup>st</sup>. If there are anexes the same rule apply, for an annex that is more than 1 page the logo should appear on the 1<sup>st</sup> page only.</p>
<p> </p>
<p>Using master page I use the following onRender on the logo image to hide it from the first page and that works fine but I’m stuck trying to apply the logo on the rest of the appropriate pages.</p>
<p><strong><span style="color:#7f0055;"><span style="font-family:consolas;"><span style="font-size:10pt;">if</span></span></span></strong><span style="color:#000000;"><span style="font-family:consolas;"><span style="font-size:10pt;">(pageNumber>1){</span></span></span></p>
<p><strong><span style="color:#7f0055;"><span style="font-family:consolas;"><span style="font-size:10pt;">this</span></span></span></strong><span style="color:#000000;"><span style="font-family:consolas;"><span style="font-size:10pt;">.getStyle().display =</span></span></span><span style="color:#2a00ff;"><span style="font-family:consolas;"><span style="font-size:10pt;">"none"</span></span></span></p>
<p><span style="color:#000000;"><span style="font-family:consolas;"><span style="font-size:10pt;">}</span></span></span></p>
<p>What I tried so far :</p>
<p>1. I thought of using a header in each of the tables but it puts a blank page after the header for some reason. (Will revisit this failing to implement option 2 below)</p>
<p> </p>
<p>2. Create a page variable for each table. Then on the pageBrake event of a data item on the first row of a table to set the relevant page variable with the current value of the pageNumber variable (or build an array with all page numbers which I want the logo on).</p>
<p>And then to do something like this onRender of the logo image:</p>
<p><strong><span style="color:#7f0055;"><span style="font-family:consolas;"><span style="font-size:10pt;">if</span></span></span></strong><span style="color:#000000;"><span style="font-family:consolas;"><span style="font-size:10pt;">(not any of pageVar1 && pageVar2 && pageVar3 ect ect){</span></span></span></p>
<p><strong><span style="color:#7f0055;"><span style="font-family:consolas;"><span style="font-size:10pt;">this</span></span></span></strong><span style="color:#000000;"><span style="font-family:consolas;"><span style="font-size:10pt;">.getStyle().display =</span></span></span><span style="color:#2a00ff;"><span style="font-family:consolas;"><span style="font-size:10pt;">"none"</span></span></span></p>
<p><span style="color:#000000;"><span style="font-family:consolas;"><span style="font-size:10pt;">}</span></span></span></p>
<p><span style="color:#000000;"><span style="font-family:consolas;"><span style="font-size:10pt;">Else </span></span></span><strong><span style="color:#7f0055;"><span style="font-family:consolas;"><span style="font-size:10pt;">this</span></span></span></strong><span style="color:#000000;"><span style="font-family:consolas;"><span style="font-size:10pt;">.getStyle().display =</span></span></span><span style="color:#2a00ff;"><span style="font-family:consolas;"><span style="font-size:10pt;">"block"</span></span></span></p>
<p> </p>
<p>But my page variables that I set with the pageNumber during the pageBrake event do not match the page number in the pdf.</p>
<p>Am I right to think that the page numbers in the generation phase are not the same as the page numbers that the pdf emitter puts on the report.</p>
<p>Is it possible to get the correct PDF page number of the page it appears on for a given data item so I can apply the logo appropriately during the presentation phase? </p>
<p>Unfortunately I can’t post the design as there is a lot of hard coded confidential information.</p>
<p>Could someone suggest another approach?</p>
<p>Kind Regards, Slavi</p>
<p> </p>
Find more posts tagged with
Comments
There are no comments yet