Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Import packages in script
Import packages in script [message #262297] Thu, 29 November 2007 02:08 Go to next message
Maria Kan is currently offline Maria KanFriend
Messages: 22
Registered: July 2009
Junior Member
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 05:26 Go to previous messageGo to next message
Jaheer is currently offline JaheerFriend
Messages: 25
Registered: July 2009
Junior Member
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] Fri, 30 November 2007 03:10 Go to previous messageGo to next message
Maria Kan is currently offline Maria KanFriend
Messages: 22
Registered: July 2009
Junior Member
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 14: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: Sat Jul 13 00:27:08 GMT 2024

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

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

Back to the top