Skip to main content



      Home
Home » Archived » BIRT » Scripting: access global vars out of <SCRIPT> tag?
Scripting: access global vars out of <SCRIPT> tag? [message #240680] Thu, 31 May 2007 10:43 Go to next message
Eclipse UserFriend
Hello,

I have a simple report with a text field.
In the OnInitialize trigger of the report I set a global var:

reportContext.setPersistentGlobalVariable("myVar", "myValue");

In the textfield I use the <SCRIPT> tag as follows:

<SCRIPT TYPE="TEXT/JAVASCRIPT">
document.write(<VALUE-OF>reportContext.getPersistentGlobalVariable( "myVar")</VALUE-OF>);
</SCRIPT>

but if I run the report I see just a blank page, but I want to see myValue
on the screen.
What I am doing wrong?

How can I use the vars from reportContext within the <script> tag?

Thanks for any help!
Re: Scripting: access global vars out of <SCRIPT> tag? [message #240821 is a reply to message #240680] Fri, 01 June 2007 10:42 Go to previous message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Try

<SCRIPT TYPE="TEXT/JAVASCRIPT">
document.write("<VALUE-OF>reportContext.getPersistentGlobalVariable( "myVar")</VALUE-OF>");
</SCRIPT>

Jason


Mr. Burns wrote:
> Hello,
>
> I have a simple report with a text field.
> In the OnInitialize trigger of the report I set a global var:
>
> reportContext.setPersistentGlobalVariable("myVar", "myValue");
>
> In the textfield I use the <SCRIPT> tag as follows:
>
> <SCRIPT TYPE="TEXT/JAVASCRIPT">
> document.write(<VALUE-OF>reportContext.getPersistentGlobalVariable( "myVar")</VALUE-OF>);
> </SCRIPT>
>
> but if I run the report I see just a blank page, but I want to see myValue
> on the screen.
> What I am doing wrong?
>
> How can I use the vars from reportContext within the <script> tag?
>
> Thanks for any help!
>
>
>
>
Previous Topic:Ploblem about bar chart
Next Topic:[2.2 RC0] Add TOC to a GridHandle at runtime doesn't work
Goto Forum:
  


Current Time: Sat Sep 13 19:11:43 EDT 2025

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

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

Back to the top