Skip to main content



      Home
Home » Archived » 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 00:25 Go to next message
Eclipse UserFriend
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 02:07 Go to previous messageGo to next message
Eclipse UserFriend
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.

[Updated on: Wed, 12 December 2012 02:08] by Moderator

Re: Height of Report Viewer embedded in iframe [message #990549 is a reply to message #990356] Thu, 13 December 2012 00:06 Go to previous messageGo to next message
Eclipse UserFriend
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 00:09] by Moderator

Re: Height of Report Viewer embedded in iframe [message #990752 is a reply to message #990549] Fri, 14 December 2012 00:42 Go to previous messageGo to next message
Eclipse UserFriend
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.
Re: Height of Report Viewer embedded in iframe [message #991011 is a reply to message #990348] Sun, 16 December 2012 18:58 Go to previous messageGo to next message
Eclipse UserFriend
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 17:19 Go to previous message
Eclipse UserFriend
You're very welcome!
Previous Topic:Generate report via web page link
Next Topic:Create elements that derive from rptlibrary using Designer API
Goto Forum:
  


Current Time: Mon Jul 07 01:22:05 EDT 2025

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

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

Back to the top