Page Break

kosta
edited February 11, 2022 in Analytics #1
<p>Hello BIRT community

I am using BIRT 2.6.2.
Can someone post me a example where the method "onPageBreak()" on some report item is used for manipulating the PDF output.
For example changing the color of some text or cell of a table. I think that method doesnt work at all.

There ia another topic where the behaviour of the "onPageBreak()"-method is mentoned:
<a data-ipb='nomediaparse' href='http://www.birt-exchange.org/forum/index.php?/topic/28511-page-break-in-tables-with-groups/?hl=onpagebreak'>http://www.birt-exchange.org/forum/index.php?/topic/28511-page-break-in-tables-with-groups/?hl=onpagebreak</a&gt;

Anyone any idea for this issue?  

Beside that, do you know some callback function where the page break is done on a group or the detail fields of a table.
I need that information because I want to use if-condtion depend on that information, i.e.
"If the row was together with anohter in the group and they are split beecause of the page break then do something."
And that should be invoked before the new page because on the first row in the new page I can make my changes.  

Thank you in advance.</p>
Warning No formatter is installed for the format ipb

Comments

  • <p>Take a look at the example I've posted regarding you page break question.  I used the following code in the onCreate() of the group header.</p><pre class="_prettyXprint">reportContext.setPersistentGlobalVariable("grp", this.getValue())if(reportContext.getPersistentGlobalVariable("color") == "yes") { this.getStyle().backgroundColor = "Yellow"; reportContext.setPersistentGlobalVariable("color", "no")}</pre><p>And then I used the following code in the onPageBreak()</p><pre class="_prettyXprint">grp = reportContext.getPersistentGlobalVariable("grp")val = this.getValue()if(grp == val) { reportContext.setPersistentGlobalVariable("color", "yes")}</pre><p>What I did with this example was highlight the start of the new group if the old group spans more than one page.  Let me know if this helps.</p>
    Warning No formatter is installed for the format ipb
  • kosta
    edited August 29, 2013 #3
    <p>Hello Kris,

    thanks for the fast response and the example.

    I created the reprot and I saw that the was yellow marking on the second page.
    Thats nice.

    First of all I dont need the group numbers on the extra group row, so i have delted them.
    Before that I copied the scripts on the other "customernumber" below.

    Now I saw that on every page the first row is marked yellow because the group is
    page break-ed and thats fine, so I tought that I have the right solution.

    But that was only coincidence, because the page break interval was set on 40.

    Setting the page break interval to 0 this kind of precuder doesn't work any more.
    The grp variable gets only once the value and that is.

    Can you see on that one?

    Thanks in advance.
     </p><p> </p><p>I am sending the rptdesign file where the outout PDF is fine but the page break interval is 40 and there are 40 rows on each page.</p>
    Warning No formatter is installed for the format ipb