Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
How to change the height and width of the master page in BIRT?
gsundar.geek
<p>[color=rgb(0,0,0);font-family:Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;]Here's what I'm trying to do : I have to change the height and width of the master page dynamically based up on the parameter which i send through the URL ?[/color]</p>
Find more posts tagged with
Comments
CBR
<p>This can be done using event handlers.</p><p> </p><p>What you need:</p><p>1) A report parameter that is used to decide about the format. Let's assume the you name it masterPage and you have the user to choose between A3 and A4 as the value for this parameter.</p><p>2) The name of your masterpage in the BIRT report. You can see the name of a particular masterpage using the outline view in the designer. The name of my masterpage in the report is master (your name will be different for sure!)</p><p> </p><p>Click on a empty space in your report in the layout view to remove selection from any element in your report (no element needs to be chosen). Then click on the script tab. Choose beforeFactory in the drop down on the top.</p><p>Add following Rhino code:</p><p> </p><p></p><pre class="_prettyXprint _linenums:0">if(params["masterPage"]=="A3") { this.getReport().getMasterPage("master").pageType = "a3";}else if(params["masterPage"]=="A4") { this.getReport().getMasterPage("master").pageType = "a4";}</pre>