Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Different header on first page of Birt Report

So there already exists this thread here which has an example that creates a different first page header than the rest of the pages. I can download this example and run it fine.

When I tried to mimic this example I couldn't do so (Clarification: After changing the source to a database of source of my own the header would not change correctly). Eventually I started to copy over individual portions of my report over to the sample one to see what triggered the issue (Clarification: I removed the differences between my report and the example one a step at a time in order to identify the exact difference which caused the issue). It ended up being my table.

For some reason that I cannot possibly explain if I add a new data set of my own, remove the table using the sample database and add a table using my data set, it won't work. When I say it won't work I mean all of a sudden the header is the same on every page and won't change for subsequent pages as expected.

If I run the debugger and put a breakpoint on the script which forces the different first and other page content (shown below) than what seems to happen is that with the sample database table, the onRender event gets called on every page... but with my table it only gets called once. That causes the master page to only check the onRender script once in the beginning, when the pageNumber variable = 1. I've been at this for hours and hours and would really like someone who might know why this is the case to help me please.

Here's the code:

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

Your help and knowledge is much appreciated,

-Asaf

like image 372
Asaf Avatar asked Jul 12 '12 19:07

Asaf


1 Answers

You indicate

I tried to mimic this example I couldn't do so

so presumably you missed a step someplace. There is DevShare BIRT: Multiple Master Pages and supporting blog entry BIRT: Multiple Master Pages with no scripting that should lead you through the process.

EDIT Based on the clarification.

Modifying an existing report in BIRT (particularly the freeware version) using the 'Layout' editor may not always be correctly updated in the XML. The XML is the actual foundation for the report. Recreating the report from scratch and only using the example as a guide should solve the problem you indicate.

When you (or your client) is not completely sure what the report is going to be in the end, versioning provides a safe method for "un-doing", because in that version it never really got done. I always save a version (and document in report description) before trying something new.

Version

like image 68
James Jenkins Avatar answered Oct 08 '22 09:10

James Jenkins