Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Height of Report Viewer embedded in iframe(Report Viewer height after rendering)
Height of Report Viewer embedded in iframe [message #990348] Wed, 12 December 2012 05:25 Go to next message
RealName Mising name is currently offline RealName Mising nameFriend
Messages: 6
Registered: July 2009
Junior Member
I have a report embedded into a web page using an iframe.

I'd like to resize the main document to avoid a scrollar in the report viewer.

From what I've found out looking at the Birt jsp pages, the report scripts resize it to accomodate to its container height, adding a scrollbar if needed.

I would like to know when the report has finished rendering. Once it is rendered, I can easily find out its absolute height and let the main document resize to fit.

Is there a way to know when the report has finished rendering? An event I could be listening to?

Other ways of solving this scenario also appreciated.

regards,
Jordi
Re: Height of Report Viewer embedded in iframe [message #990356 is a reply to message #990348] Wed, 12 December 2012 07:07 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1663
Registered: July 2009
Senior Member

There is a report script event called afterRender. You might try there, first. From the designer, you can get there by clicking in an empty spot in the design window, then clicking on the script tab, below the design window, and selecting afterRender from the drop down.

Michael

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.

[Updated on: Wed, 12 December 2012 07:08]

Report message to a moderator

Re: Height of Report Viewer embedded in iframe [message #990549 is a reply to message #990356] Thu, 13 December 2012 05:06 Go to previous messageGo to next message
RealName Mising name is currently offline RealName Mising nameFriend
Messages: 6
Registered: July 2009
Junior Member
Doesn't seem to being called.

I cannot see where the script is sent to the client either.

Is this script really run in the client(in the browser)?

I want to do something like this:

afterRender event script:
parent.updateHeight(document.getElementById("__BIRT_ROOT").scrollHeight);

Main document script:
function updateHeight(birtViewerHeight) {
document.getElementById("birtIframeId").style.height = (birtViewerHeight + 150) + "px";
}

So in effect I am forcing the Birt "Document" not to have scrollbars. I can do this manually with Firebug and it works, but the afterRender event script is not working.

[Updated on: Thu, 13 December 2012 05:09]

Report message to a moderator

Re: Height of Report Viewer embedded in iframe [message #990752 is a reply to message #990549] Fri, 14 December 2012 05:42 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1663
Registered: July 2009
Senior Member

Ah. No. That's server side. Sorry for misunderstanding what you were looking for. You can call client side script from and HTML text box using <script> tags. You should be able to pass info from the report using the <value-of> and <viewtime-value-of> tags.

Michael

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.
Re: Height of Report Viewer embedded in iframe [message #991011 is a reply to message #990348] Sun, 16 December 2012 23:58 Go to previous messageGo to next message
RealName Mising name is currently offline RealName Mising nameFriend
Messages: 6
Registered: July 2009
Junior Member
Excellent, it is working now.

I put it in the Master Page footer, where the date text box is:

<page-footer>
<text id="3">
<property name="contentType">html</property>
<text-property name="content"><![CDATA[<value-of>new Date()</value-of>
<script type="text/javascript" language="javascript">parent.updateHeight(document.getElementById("__BIRT_ROOT").scrollHeight);</script>]]>
</text-property>
</text>
</page-footer>

Thanks Michael, much appreciated.
Re: Height of Report Viewer embedded in iframe [message #991401 is a reply to message #991011] Tue, 18 December 2012 22:19 Go to previous message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1663
Registered: July 2009
Senior Member

You're very welcome!

Michael

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.
Previous Topic:Generate report via web page link
Next Topic:Create elements that derive from rptlibrary using Designer API
Goto Forum:
  


Current Time: Tue Nov 25 02:07:46 GMT 2014

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

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