I built a report using BIRT and Data tables . Everything works as expected. However, the height and width of the BIRT viewer are not dynamic. They are static and therefore scrolling is applied. Therefore, I wrote code to make height and width of a 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>
Note that the height and width of the BIRT view are 700px and 1136px respectively. The above code does not do dynamic height and width .
How can I increase BIRT dynamics and width? I added a picture for a clear understanding. 
As you can see in the picture, it adds vertical scrolling. How to prevent this and increase the height of the BIRT depending on the height of the table?
source share