Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Multiple Master Pages
mmd003
Hello,
Is there a way to select which master page will be printed?
I have a report that has multiple tables. Depending on a parameter that
is sent I would like to determine which header to print.
Ie. If Parameter = A
use masterPage1 (Only)
If parameter = B
User masterPage2 (Only)
I have tried a few things, and I always only get the first master page
when my parameter is for report B.
I tried the beforeRender/beforeFactory, and also the page break functionality for the different
tables with no success.
I would appreciate any help on this!!
Thank You!
Find more posts tagged with
Comments
mwilliams
First, don't specify a masterpage in the property editor for each table, if you are. Then, in the onCreate for the first table in your report, put something like:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
if (params["myParameter"] == "A"){
this.getStyle().masterPage = "myMasterPage1"
}
else{
this.getStyle().masterPage = "myMasterPage2"
}
</pre>
<br />
If no masterpage is set in any element but the first, it will follow what the masterpage of the first element is. Hope this helps.
mmd003
Perfect!!! It's exactly what I needed!
Thanks so much for your quick response!
Appreciate the help!
mmd003
I spoke too soon...
It seems to always show Master Page 1 with this method.
Any other ideas?
mmd003
I started over, and it seems to work now.
Thanks again for your help!
mwilliams
You're welcome! Glad to help! Let us know whenever you have questions! Welcome to the BIRT Exchange community!