Skip to main content



      Home
Home » Archived » BIRT » Import packages in script
Import packages in script [message #262297] Wed, 28 November 2007 21:08 Go to next message
Eclipse UserFriend
Hi,

I'm wondering if I already did the "importPackage(Packages.....)" in the
"initialize" script tab,
do I still need to do the same import statement everywhere else that I need
to use those imported functions?

eg.
If I have this in the "intialize" script tab in the report

importPackage(Packages.mypackage)
obj = new mypackageCreate( ); //global variable

Do I still need to do the import statment in lets say a report element
expression?

obj.mypackageFunc( ); // calling the imported function in the report element
expression

Maria.
Re: Import packages in script [message #262303 is a reply to message #262297] Thu, 29 November 2007 00:26 Go to previous messageGo to next message
Eclipse UserFriend
Hi Maria,

in "initialize" method just import the package and in "beforeFactory"
script declare global variable as u want, like following.

in initialize script
---------------------
importPackage(Packages.mypackage)

in beforeFactory script
----------------------
obj = new mypackageCreate( );

now , 'obj' u can use anywhere in report

Regards,
Shaik
Re: Import packages in script [message #262447 is a reply to message #262303] Thu, 29 November 2007 22:10 Go to previous messageGo to next message
Eclipse UserFriend
What about in DataSet's script section?

Would packages imported in the "initialize" script tab in the report be
usable in the Data Set's script section?


in initialize script
---------------------
importPackage(Packages.mypackage)


in beforeOpen script in the Data Set
---------------------------------------
obj = new mypackageCreate( );



Maria.

"Shaik" <shaikjaheer@alshaya.com> wrote in message
news:a9b2cb7cc2709568979b115da0fb738b$1@www.eclipse.org...
> Hi Maria,
>
> in "initialize" method just import the package and in "beforeFactory"
> script declare global variable as u want, like following.
>
> in initialize script
> ---------------------
> importPackage(Packages.mypackage)
>
> in beforeFactory script
> ----------------------
> obj = new mypackageCreate( );
>
> now , 'obj' u can use anywhere in report
>
> Regards,
> Shaik
>
Re: Import packages in script [message #262471 is a reply to message #262303] Fri, 30 November 2007 09:29 Go to previous message
Eclipse UserFriend
Originally posted by: calvinwongkh_delete.this.thanks_.yahoo.com

Hi Shaik,

If I defined a globalized function in "initialize" that uses a class in
the package, do I need to declare the class into the the global variable
as well?

Thanks,
Calvin

Shaik wrote:
> Hi Maria,
>
> in "initialize" method just import the package and in "beforeFactory"
> script declare global variable as u want, like following.
>
> in initialize script
> ---------------------
> importPackage(Packages.mypackage)
>
> in beforeFactory script
> ----------------------
> obj = new mypackageCreate( );
>
> now , 'obj' u can use anywhere in report
>
> Regards,
> Shaik
>
Previous Topic:Rendering node lists.
Next Topic:Setting BIRT_HOME
Goto Forum:
  


Current Time: Wed Apr 30 15:18:02 EDT 2025

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

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

Back to the top