Home
Analytics
Dynamic Header on Master Page (dependent on table groups)
Stephan Lau
<p>Hello everybody,</p><p> </p><p>I tried to create a report with a dynamic text element in the header of the master page.</p><p>I'd like to do this to make the current chapter visible on every page. Without having to create a dedicated master page for every chapter.</p><p> </p><p>As attachment you will find two files. One simple example report design (BIRT 4.3 - based on SampleDB) and the generated PDF document.</p><p> </p><p><span class='bbc_underline'>Steps I tried:</span></p><p>I created a report variable (initialized with an empty string) and I placed it at the header of my master page.</p><p>My report content is placed inside a a grid. The table is grouped by job titles. Every group is placed on a separate page. The job-title-data-field as an "onCreate-Script" which changes the report-variable to the current job-title.</p><p> </p><p>Sadly the result is only visible at the following page. Too late...</p><p> </p><p>Is the there a user-friendly way to change the report header dependent on the report content?</p><p> </p><p>Thanks in advance for any hint!</p>
Find more posts tagged with
Comments
BRM
<p>I've had this issue before too. It is caused by when the report header and footers run in the event sequence (which is before the report data runs and so the report data is not available to the header/footer).</p><p> </p><p>In my case i solved this by using grids and tables and page breaks in the body of the report that "looked" like a header and footer when the report was rendered. It can be tricky to get the spacing correct.</p><p> </p><p>Hope that helps.</p>
Stephan Lau
<p>Thank you for your reply!</p><p> </p><p>This could be a possible workaround for simple reports.</p><p>But in my case I need to create complex reports with several pages.</p><p>So it is nearly impossible to "fake" the master pager header with grids.</p><p> </p><p>We create PDF reports with several pages and a company specific header. Something like that:</p><pre class="_prettyXprint _lang-nocode">
|Company Logo| "name of the report"
"name of the chapter" "page x of y"</pre><p>I thought this should work somehow like here:</p><p><a data-ipb='nomediaparse' href='
http://www.eclipse.org/birt/phoenix/project/notable2.5.php#jump_4'>http://www.eclipse.org/birt/phoenix/project/notable2.5.php#jump_4</a></p><p> </p><p>But
you are right - in this example the dynamic header is part of the report content. It is simple the table header. Not the reports header.</p><p> </p><p>I wonder if there is realy no possibility to do this "the right way".</p><p>No workaround - just a solution for a (so do I think) a common problem.</p><p> </p><p>Obviously it is possible to render dynamic content, which is only known <strong>after</strong> the content rendering.</p><p>As we can see at the "total page count". Sadly this variable is global defined once. Somehow it seems to be a view-time-variable...</p><p> </p><p> </p><p>...so I thought about a way to define chapter names a more static way...and a new question came up:</p><p> </p><p>Is it possible to create a report with several body elements. Every element with <strong>pagebreak before</strong> and every element defines another "chapter name" to a report variable?</p><p> </p><p>Thanks in advance
!</p>
BRM
<p>So see if this helps. You can have any number of rows in the group header. So you can make this look like a master page header. You have access to the total report pages in the group header which is part of your requirement.</p>