I constructed a report by using BIRT
and Data tables
. Everything is working as expected. However height
and width
of BIRT viewer
aren't dynamic. They are static and hence scroll is applied. So I wrote a code to make height
and width
of BIRT viewer
dynamic.
function resizeFrame(e,f){
var x = document.getElementsByTagName("iframe");
var winW = 1112, winH = 486;
if (document.body && document.body.offsetWidth) {
winW = document.body.offsetWidth;
winH = document.body.offsetHeight;
}
if (document.compatMode=='CSS1Compat' && document.documentElement && document.documentElement.offsetWidth ) {
winW = document.documentElement.offsetWidth;
winH = document.documentElement.offsetHeight;
}
if (window.innerWidth && window.innerHeight) {
winW = window.innerWidth;
winH = window.innerHeight;
}
x[0].style.width = winW + "px";
x[0].style.height = winH + "px";
console.log(f,e);
}
BIRT code is:
<birt:viewer id="birtViewer" reportDesign="/sampleReport.rptdesign"
pattern="run" height="700" width="1136" scrolling="none"
showParameterPage="false" isHostPage="false">
</birt:viewer>
Please note that height and width of BIRT viewer are 700px
and 1136px
respectively. Above code isn't making height
and width
dynamic.
How can I make BIRT height and width dynamic? I've added a picture for clear understanding.
As you can see in picture, it is adding vertical scrolling. How to prevent that and make height of BIRT increase based on table height?