BIRT Exchange Forum: Dynamic size of javascript viewer - BIRT Exchange Forum

Jump to content


 

BIRT Poll: To best make a table fill a pdf page before breaking (PL=page layout, PBI=page break interval) set:

PL: auto, PBI: 0PL: fixed, PBI: 0PL: auto, PBI: 1000000PL: fixed, PBI: 1000000
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Dynamic size of javascript viewer Rate Topic: -----

#1 User is offline   sseaman Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 9
  • Joined: 19-April 12


Posted 19 April 2012 - 10:54 AM

I'm curious if there is a way to make the size of the BIRT report in the javascript based viewer change based upon the parent div's size (which we have set at 100% so it changes as the window is resized)

Sorry if this is an easy question but I'm very new to this.

Currently I'm accomplishing this by registering for the window resize event and then manually modifying the #NavigationBar, .contentPanel, and .floatPanel DOM elements
0

#2 User is offline   averma Icon

  • Senior Member
  • Icon
  • View blog
  • Group: Administrators
  • Posts: 713
  • Joined: 08-August 07


Posted 23 April 2012 - 10:22 AM

Hi sseaman,
On your resize event handler, call viewer.setWidth(xxx), viewer.setHeight(xxx), then viewer.submit(...) to change the size of the viewer.
Ashwini

Follow me on Twitter
Read my Blog BIRT Rocks!
0

#3 User is offline   sseaman Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 9
  • Joined: 19-April 12


Posted 23 April 2012 - 12:34 PM

View Postaverma, on 23 April 2012 - 11:22 AM, said:

Hi sseaman,
On your resize event handler, call viewer.setWidth(xxx), viewer.setHeight(xxx), then viewer.submit(...) to change the size of the viewer.


If I do that the viewer makes two network requests each time the view port is resized. This is not acceptable as we have up to 4000 concurrent users. Why would it need to go back to the server for a browser side issue that should easily be solved by non-strict width based css?

Isn't there a way in the birt reports layout to have the width set to a percentage (say, 100%)?
0

#4 User is offline   sseaman Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 9
  • Joined: 19-April 12


Posted 23 April 2012 - 12:53 PM

I found the solution by digging through the source JS.

If you call setSize() on the viewer it will update the container. setWidth and setHeight however will not. It will only set the sizes, but not resize them.


A bit confusing...
0

#5 User is offline   averma Icon

  • Senior Member
  • Icon
  • View blog
  • Group: Administrators
  • Posts: 713
  • Joined: 08-August 07


Posted 23 April 2012 - 03:38 PM

submit() results in additional round trip, setSize() should be right for your use case.
Ashwini

Follow me on Twitter
Read my Blog BIRT Rocks!
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users