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)
change width & height of Birt Web Viewer
rogerb99
<p>I'm using Birt Report Designer to create charts & reports. On some charts, I have a drill down which opens up a target report in a new window. How do I size the Birt Web Viewer of target report to be a specific size. Right now, it is same size as the browser window that invoked the drill down. The target report is only filling up 30% of the Viewer window. Some target reports need to be of one size and other target reports of a different size.</p>
Find more posts tagged with
Comments
kclark
<p>I haven't tried this yes but I think you could use a hidden parameter in the reports you a drilling down to. You could have a height and width parameter. Then place a text item at the top of your report. Then from the onCreate() check to see if the parameter contain a value and if they do add some script like this</p><pre class="_prettyXprint"><script>var w=window.open('','', 'width=100,height=100');w.resizeTo(500,500);</script></pre><p>Then you just need to make sure your passing values to these parameters from the hyperlink UI.</p>
rogerb99
<p>Thanks for the idea. I will try it on Mon.</p>
rogerb99
<p>I added a text object with HTML format to top of Report.
From that text object's onCreate method, I added the following code.
if (params["windowHeight"] > 50 && params["windowWidth"] > 50 ) {
var h = params["windowHeight"].value, w = params["windowWidth"].value;
var wind=window.open('','', 'width=100,height=100');
wind.resizeTo( w , h );
}
In Birt Report Designer, I get the following error when I view report in Web Viewer:
ReferenceError: "window" is not defined.</p><p> </p><p>Thanks for any help on this.</p>
kclark
<p>Try something like this</p><pre class="_prettyXprint"> if (params["windowHeight"] > 50 && params["windowWidth"] > 50 ) { var h = params["windowHeight"].value, w = params["windowWidth"].value; this.text = "<script>window.resizeTo(" + w + "," + h ");</script>"; }</pre>
rogerb99
<p>Works great. Thanks.</p>
kclark
<p>You're welcome, glad it's working!
</p>