Jump to content

BIRT Developer Center Download


Photo
- - - - -

Different master page header on the first page of report


  • Please log in to reply
2 replies to this topic

#1 erisa

erisa

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 06 March 2013 - 12:31 AM

I need to have one master page header on the first page and another master page header on the next pages of report.
I am using 3.7.1 version.

1. I inserted a grid with two rows to the master page header.
2. I put one new grid into each of the rows.
First nested grid for the first page header, second nested grid for the next pages header.
3. I set an onRender scripts:

//first nested grid
if( pageNumber > 1 ){
this.getStyle().display = "none";
}

//second nested grid
if( pageNumber == 1 ){
this.getStyle().display = "none";
}else{
this.getStyle().display = "block";
}

This works ok with the sample database, from JDBC Data Source.
But I need XML Data Source and with that it does not work at all.
It seems as if with the sample database table, the onRender event gets called on every page, but with my XML Data Source it only gets called once.

Please, If you could help me solve this mysterious problem I would appreciated it very much.

erisa

#2 kclark

kclark

    BIRT Guru

  • Administrators
  • 2061 posts

Posted 06 March 2013 - 09:32 AM

Can you post your rptdesign with some sample data? I've attached my example the seems to be working for your needs. I've also attached some sample xml data with it. I created two nested grids in the master page header. Then I used your script for each grid. Page one shows "Label 1" and all pages > 1 displays "Label 2"

Attached Files


Kristopher Clark

Actuate Corporation – The BIRT Company™

http://www.actuate.com | http://birtondemand.com

 

My Blog

Twitter

LinkedIn
Facebook
 


#3 erisa

erisa

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 06 March 2013 - 11:44 PM

Thank you for answering. In your sample you are using BIRT version 4.2.1. I am using 3.7.1 and I am stucked to it. Could it be a bug in 3.7.1 version? I attached my report:

Attached Files