Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Does BIRT Report Viewer have zoom in/out function
Does BIRT Report Viewer have zoom in/out function [message #366637] Fri, 16 January 2009 08:27 Go to next message
gavin is currently offline gavinFriend
Messages: 7
Registered: July 2009
Junior Member
Hi all,
I want to add a toolbar like zoom(+) and zoom(-) on the BIRT Report
Viewer to change size of my report.How can I do? please help me.......

Thanks in advance.
Gavin Cao.
Re: Does BIRT Report Viewer have zoom in/out function [message #366638 is a reply to message #366637] Fri, 16 January 2009 17:32 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Gavin,

You may be able to add some code like the follow, which does a zoom on a
specific report.

<script language="javascript">
var orginal =screen.width;

function zoomX()
{
var x= document.getElementById("Document" );
var lst = document.getElementById("ZL");
var zl = lst.options[lst.selectedIndex].value;
x.style.zoom = zl;
}
</script>


<FORM name="Fm">
<CENTER>
<BR>
<BR>
<SELECT ID=ZL Name=ZoomLevel onChange="zoomX()">
<OPTION Value=.75>75%</OPTION>
<OPTION Value=1 selected>100%</OPTION>
<OPTION Value=1.25>125%</OPTION>
<OPTION Value=1.50>150%</OPTION>
<OPTION Value=2.0>200%</OPTION>
</SELECT>
<BR>
</CENTER>
</FORM>

I just added the code in a text element and set the the type to HTML.

Jason

gavin wrote:
> Hi all,
> I want to add a toolbar like zoom(+) and zoom(-) on the BIRT Report
> Viewer to change size of my report.How can I do? please help me.......
>
> Thanks in advance.
> Gavin Cao.
>
Re: Does BIRT Report Viewer have zoom in/out function [message #366644 is a reply to message #366638] Sun, 18 January 2009 04:19 Go to previous messageGo to next message
gavin is currently offline gavinFriend
Messages: 7
Registered: July 2009
Junior Member
Jason,
Thanks for you reply,I try the code,but the scroll is undisplay,how can
i do?
I want to add the code when generate html from the .rptdesign file,would
you give me some advise?

thanks again.

Gavin
Re: Does BIRT Report Viewer have zoom in/out function [message #366659 is a reply to message #366644] Tue, 20 January 2009 00:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Gavin,

You may be able to modify the viewer plugins webcontent directory, which
contains css, js, and jsp files to create to the viewer to add the
scroll bars. You can always use the visibility property to hide the
text element containing the code for every output except html.

Jason

gavin wrote:
> Jason,
> Thanks for you reply,I try the code,but the scroll is undisplay,how
> can i do?
> I want to add the code when generate html from the .rptdesign file,would
> you give me some advise?
>
> thanks again.
>
> Gavin
>
Re: Does BIRT Report Viewer have zoom in/out function [message #366662 is a reply to message #366659] Tue, 20 January 2009 03:44 Go to previous messageGo to next message
gavin is currently offline gavinFriend
Messages: 7
Registered: July 2009
Junior Member
Hi Jason,
I have changed the
plugins\org.eclipse.birt.report.viewer_2.3.1.v20080908\birt\ webcontent\birt\styles\style.css,and
the scroll bar has been display.But,the scroll bar join zoom in/out in
IE7,and the scroll bar is not correct in BIRT Report Viewer 2.3.1 when
change the zoom value.Why is it so different? How can i do? pl help me....

Thanks honestly

Gavin
Re: Does BIRT Report Viewer have zoom in/out function [message #366664 is a reply to message #366662] Tue, 20 January 2009 05:11 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Gavin,

What is it doing? What did you change in the style.css

Jason

gavin wrote:
> Hi Jason,
> I have changed the
> plugins\org.eclipse.birt.report.viewer_2.3.1.v20080908\birt\ webcontent\birt\styles\style.css,and
> the scroll bar has been display.But,the scroll bar join zoom in/out in
> IE7,and the scroll bar is not correct in BIRT Report Viewer 2.3.1 when
> change the zoom value.Why is it so different? How can i do? pl help me....
>
> Thanks honestly
>
> Gavin
>
Re: Does BIRT Report Viewer have zoom in/out function [message #366666 is a reply to message #366664] Tue, 20 January 2009 05:46 Go to previous messageGo to next message
gavin is currently offline gavinFriend
Messages: 7
Registered: July 2009
Junior Member
Jason,

I change the function in style.css.
orginal:
.birtviewer_document_fragment
{
overflow:auto;
position:relative;
border-style: solid;
border-width: 2px;
border-top-color: #404040;
border-left-color: #404040;
border-right-color: #D0D0D0;
border-bottom-color: #D0D0D0;
}

I have changed like blow:
.birtviewer_document_fragment
{
overflow-x:scroll;
overflow-y:scroll;
position:relative;
border-style: solid;
border-width: 2px;
border-top-color: #404040;
border-left-color: #404040;
border-right-color: #D0D0D0;
border-bottom-color: #D0D0D0;
}
Re: Does BIRT Report Viewer have zoom in/out function [message #366667 is a reply to message #366666] Tue, 20 January 2009 05:58 Go to previous messageGo to next message
gavin is currently offline gavinFriend
Messages: 7
Registered: July 2009
Junior Member
Jason,
If I don't change the "overflow:auto;" to
"overflow-x:scroll;overflow-y:scroll;" ,the horizontal scroll bar is never
display in IE7. Are there some other way to do for me?
I run the report in BIRT Report Viewer the scroll bar always display
even though i change the zoom value is 0.1.
IE7 or BIRT Report Viewer , which I should choose?
Re: Does BIRT Report Viewer have zoom in/out function [message #366669 is a reply to message #366667] Tue, 20 January 2009 06:22 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Gavin,

I tried to do this as well and could not get it.
Look at

// workaround for bug 165750, overflow-x and overflow-y only used in IE
if( BrowserUtility.__isIE( ) )
{
container.style.overflowX = "visible";
container.style.overflowY = "visible";

in AbstractReportComponent.js. You could try changing that.

Jason

gavin wrote:
> Jason,
> If I don't change the "overflow:auto;" to
> "overflow-x:scroll;overflow-y:scroll;" ,the horizontal scroll bar is
> never display in IE7. Are there some other way to do for me?
> I run the report in BIRT Report Viewer the scroll bar always display
> even though i change the zoom value is 0.1.
> IE7 or BIRT Report Viewer , which I should choose?
>
Re: Does BIRT Report Viewer have zoom in/out function [message #656841 is a reply to message #366637] Mon, 28 February 2011 18:37 Go to previous messageGo to next message
eminaguil is currently offline eminaguilFriend
Messages: 8
Registered: February 2011
Junior Member
Hi,
I have tried your code and it works in the report, but i want this function in the viewer toolbar so i put the code in ToolbarFragment.jsp but it doesn´t work

i put the js before the toolbar
<script language="javascript">
	var orginal =screen.width;

	function zoomX()
	{
		var x= document.getElementById("Document" );
		var lst = document.getElementById("ZL");
		var zl = lst.options[lst.selectedIndex].value;
		x.style.zoom = zl;
	}
</script>

<TD COLSPAN='2'>
		<DIV ID="toolbar">


and add a column after the print button



					<TD WIDTH="6px"/>
					<TD WIDTH="45px">
					   <SELECT ID="ZL" Name="ZoomLevel" onChange="zoomX()">
							<OPTION Value=".50">50%</OPTION>
							<OPTION Value=".75">75%</OPTION>
							<OPTION Value=".90">90%</OPTION>
							<OPTION Value="1" selected>100%</OPTION>
							<OPTION Value="1.25">125%</OPTION>
							<OPTION Value="1.50">150%</OPTION>
						</SELECT>
					</TD>


I´ve used firebug to check if the Document element exists in this context and it does.

Can somebody give me a tip?
Re: Does BIRT Report Viewer have zoom in/out function [message #656864 is a reply to message #656841] Mon, 28 February 2011 19:21 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

What browser are you using to test?
Also you could try changing the function to use:
document.body.style.zoom=newZoom;

I do not think the zoom property is supported in all browsers.

Jason

On 2/28/2011 1:37 PM, eminaguil@gmail.com wrote:
> Hi, I have tried your code and it works in the report, but i want this
> function in the viewer toolbar so i put the code in ToolbarFragment.jsp
> but it doesn´t work
>
> i put the js before the toolbar
>
> <script language="javascript">
> var orginal =screen.width;
>
> function zoomX()
> {
> var x= document.getElementById("Document" );
> var lst = document.getElementById("ZL");
> var zl = lst.options[lst.selectedIndex].value;
> x.style.zoom = zl;
> }
> </script>
>
> <TD COLSPAN='2'>
> <DIV ID="toolbar">
>
>
> and add a column after the print button
>
>
>
>
> <TD WIDTH="6px"/>
> <TD WIDTH="45px">
> <SELECT ID="ZL" Name="ZoomLevel" onChange="zoomX()">
> <OPTION Value=".50">50%</OPTION>
> <OPTION Value=".75">75%</OPTION>
> <OPTION Value=".90">90%</OPTION>
> <OPTION Value="1" selected>100%</OPTION>
> <OPTION Value="1.25">125%</OPTION>
> <OPTION Value="1.50">150%</OPTION>
> </SELECT>
> </TD>
>
>
> I´ve used firebug to check if the Document element exists in this
> context and it does.
> Can somebody give me a tip?
>
Re: Does BIRT Report Viewer have zoom in/out function [message #656877 is a reply to message #366637] Mon, 28 February 2011 21:06 Go to previous messageGo to next message
eminaguil is currently offline eminaguilFriend
Messages: 8
Registered: February 2011
Junior Member
Thanks for your answer Jason.

I'm using IE8 and FF3.6 but the style.zoom don´t work.
I tried changing the zoom in the document body like you said, or using the style sizeFont but nothing

________________
Edwin
Re: Does BIRT Report Viewer have zoom in/out function [message #656887 is a reply to message #656877] Mon, 28 February 2011 21:53 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

What version of BIRT are you using?

On 2/28/2011 4:06 PM, Edwin wrote:
> Thanks for your answer Jason.
>
> I'm using IE8 and FF3.6 but the style.zoom don´t work.
> I tried changing the zoom in the document body like you said, or using
> the style sizeFont but nothing
>
> ________________
> Edwin
Re: Does BIRT Report Viewer have zoom in/out function [message #656896 is a reply to message #656887] Mon, 28 February 2011 22:31 Go to previous messageGo to next message
eminaguil is currently offline eminaguilFriend
Messages: 8
Registered: February 2011
Junior Member
Viewer Version : 2.6.0

Engine Version: 2.6.0

JRE version: 1.6.0_24

_____________
Edwin
Re: Does BIRT Report Viewer have zoom in/out function [message #657150 is a reply to message #656896] Tue, 01 March 2011 18:09 Go to previous messageGo to next message
eminaguil is currently offline eminaguilFriend
Messages: 8
Registered: February 2011
Junior Member
Hi,
I've done it using css3 Twisted Evil . I´ve tested in FF 3.6, Chrome 9.059 and Opera 11.01,

I don't have IE9 for testing, but maybe I will try using the Microsoft's Matrix Filter for compatibility issues.

Here is the code to insert in the ToolbarFragment.jsp

the script (just before the toolbar) is
<script language="javascript">
	var zoomData = [
		{scl: ".4", tra: "-76%"},
		{scl: ".5", tra: "-50%" },
		{scl: ".6", tra: "-33%" },
		{scl: ".7", tra: "-21.5%" },
		{scl: ".8", tra: "-12.5%" },
		{scl: ".9", tra: "-5.5%" },
		{scl: "1.0", tra: "0%" },
		{scl: "1.1", tra: "4.5%" },
		{scl: "1.2", tra: "8.5%" },
		{scl: "1.3", tra: "11.5%" }
	];

	function zoomX()
	{
		var x = document.getElementById("Document");
		var lst = document.getElementById("ZL");
		var zl = lst.options[lst.selectedIndex].value;
		var tra = "scale(" + zoomData[zl].scl + ") translate(" + zoomData[zl].tra + "," + zoomData[zl].tra + ")";
		
		x.style.OperaTransform = tra;
		x.style.msTransform = tra;
		x.style.MozTransform = tra;
		x.style.webkitTransform = tra;
	}
</script>

<TD COLSPAN='2'>
		<DIV ID="toolbar">


and the control after the print button
<TD WIDTH="6px"/>
					<TD WIDTH="45px">
					   <SELECT ID="ZL" Name="ZoomLevel" onChange="zoomX()">
							<OPTION Value="1">50%</OPTION>
							<OPTION Value="2">60%</OPTION>
							<OPTION Value="3">70%</OPTION>
							<OPTION Value="4">80%</OPTION>
							<OPTION Value="5">90%</OPTION>
							<OPTION Value="6" selected>100%</OPTION>
							<OPTION Value="7">110%</OPTION>
							<OPTION Value="8">120%</OPTION>
							<OPTION Value="9">130%</OPTION>
						</SELECT>
					</TD>


Best regards
______________
Edwin
Re: Does BIRT Report Viewer have zoom in/out function [message #657158 is a reply to message #657150] Tue, 01 March 2011 18:23 Go to previous message
eminaguil is currently offline eminaguilFriend
Messages: 8
Registered: February 2011
Junior Member
Oops, it's not working in Opera,
sombody knows how to translate the operas's css '-o-transform' to js?
Previous Topic:Bar Chart: Label overlapping the bar when chart is too small
Next Topic:Chart with Depth - Changing the Angle of the "3D"
Goto Forum:
  


Current Time: Tue Apr 16 17:53:40 GMT 2024

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

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

Back to the top