Home
Analytics
Creating multiple masterpages
kumaresh
Hi
i have to create a report that has two Masterpages. One Masterpage will be used only for the first page of the report. For the rest of the report, the other Masterpage will have to be used.
I have created two Masterpages for the report (say, MasterpageOne and MasterpageTwo).
The report content has one long table that has continuous data and runs for more than 200 pages.
Could someone help me out in explaining me the method that i should overwrite to use MasterpageOne
for page - one and MasterpageTwo for rest of the report. I am in need of the Java Script functions that has to be coded here.
I tried with If - else condition in various methods in vain for the past two days!
Also what is the Javascript function to get the page number of the report? i get an error when i used pageNumber(); ...
Thanks in advance.
Find more posts tagged with
Comments
JasonW
Unfortunately using script to change the master page beyond the beforeFactory is not possible. The best way to handle this is to create two tables in your report and limit the number of rows on the first table to the rows of data that will appear on the first page and limit the second table to the rest of the rows. Then set master page 1 to table 1 and master page 2 to table 2. Add a computed column to your dataset to count the number of rows and then use filters on the two tables to filter the row numbers displayed. Look at the attached example.
Jason
kumaresh
Thank you, Jason.
kumaresh
Hi
Sorry for delayed reply..
What can be done if the number of rows on first page cannot be decided in advance?
Also, in the report you have sent, if we change the Page break to a lesser number, say 10, then the first master page (MP1) repeats for first few pages, here until row count reaches 40.
And also, if we are limiting the number of rows for first page, the same number of rows should be present for rest of the pages too. But in case of grouped reports, the number of rows in the table will be varying as each group is executed, the header for the group occupies additional page space!
JasonW
Can you log an enhancement to set master page based on page number?
Jason
kumaresh
Sorry.. didn't get ahat you meant.. How do I log an enhancement?
JasonW
Take a look at this link (bugzilla):
http://www.eclipse.org/birt/phoenix/community.php
Jason