Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » dynamic height & width for birt:viewer in jsp
dynamic height & width for birt:viewer in jsp [message #734243] Fri, 07 October 2011 08:51 Go to next message
gaurikate is currently offline gaurikateFriend
Messages: 15
Registered: August 2011
Junior Member
Hi,
I am using an embedded birtviewer in jsp to display the report.
here i'm using tag as
<script="text/javascript">
function getScreenWidth()
{
return screen.width;
}
function getScreenHeight()
{
return screen.height;
}
</script>
<body>
<birt:viewer id="birtViewer" reportDesign="pacacct.rptdesign"
pattern="frameset"
height= getScreenHeight();/* how should i assign getScreenHeight()value here */
width=getScreenWidth();/* how should i assign the getScreenWidth()value here */
format="html">
</birt:viewer>
</body>
i'm getting the screen width and height by using the above javascript code.Here i want to know how to set javascript value to height and width of the birt tag. Because i want to set the viewer to be fixed based on the client window size. So i want to make it as dynamically.
Please help me.
Thanks in Advance.
Re: dynamic height & width for birt:viewer in jsp [message #734260 is a reply to message #734243] Fri, 07 October 2011 10:05 Go to previous messageGo to next message
gaurikate is currently offline gaurikateFriend
Messages: 15
Registered: August 2011
Junior Member
plz reply
Re: dynamic height &amp; width for birt:viewer in jsp [message #734396 is a reply to message #734260] Fri, 07 October 2011 15:58 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

If you want it to take up the full page why not just set the attribute
isHostPage to true?

If you have to do it in script use something like what is described here:
http://www.javascripter.net/faq/browserw.htm
//example

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib uri="/birt.tld" prefix="birt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

<body onload=”resizeFrame(document)” bgcolor=”#cccccc”>

<script type=”text/javascript”>
// Firefox worked fine. Internet Explorer shows scrollbar because of
frameborder
function resizeFrame(f) {

var x = document.getElementsByTagName("iframe");



var winW = 630, winH = 460;
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";

}
</script>



</head>
<body>

<birt:viewer id="birttViewer"
reportDesign="TopNPercent.rptdesign"
format="html"
scrolling="true"
height="700"
width="950"
pageNum="2"
frameborder="false"
showNavigationBar="false"
showToolBar="false"
pattern="run"
locale="fr_CA"
isHostPage="false">
</birt:viewer>


</body>
</html>


Jason

On 10/7/2011 6:05 AM, gaurikate wrote:
> plz reply
Re: dynamic height &amp; width for birt:viewer in jsp [message #734896 is a reply to message #734396] Mon, 10 October 2011 10:28 Go to previous message
gaurikate is currently offline gaurikateFriend
Messages: 15
Registered: August 2011
Junior Member
Hello Sir,

Thanks a lot..It works absolutely fine now..... Smile
Thank you very much...
Previous Topic:Uninstall or hide report item in palette
Next Topic:change image pressing a button
Goto Forum:
  


Current Time: Thu Apr 25 09:42:07 GMT 2024

Powered by FUDForum. Page generated in 0.02477 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top