BIRT
とData tables
を使用してレポートを作成しました。すべてが期待どおりに動作しています。ただし、height
とwidth
はBIRT viewer
です。動的ではありません。それらは静的であり、したがってスクロールが適用されます。だからheight
とwidth
をBIRT viewer
というように動的にするコードを書いた。コンテンツに基づいて動的にBIRTビューアの高さと幅を設定する
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>
BIRTビューアの高さと幅に注意してくださいそれぞれ700px
と1136px
です。上のコードはheight
とwidth
を動的にしていません。
BIRTの高さと幅を動的にするにはどうしたらいいですか?私は明確な理解のために絵を追加しました。
画像のように、縦スクロールが追加されています。それを防止し、テーブルの高さに基づいてBIRTの高さを上げる方法は?