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