Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » How to call methods of a data source or data set from a script or expression?
How to call methods of a data source or data set from a script or expression? [message #368666] Thu, 18 June 2009 09:00 Go to next message
Eclipse UserFriend
Originally posted by: an.ma.web.de

Hello,

I want to call a particular method in one of my data sources from a
script or an expression in the report. However, "this" in the
corresponding scripts refers to a JSDataSourceImpl or JSDataSetImpl and
there seems to be no way to obtain the actual implementation of
IConnection or IQuery from there.

How can I get access to the actual data source or data set
implementation to call one of its methods?
--
Andreas
Re: How to call methods of a data source or data set from a script or expression? [message #368696 is a reply to message #368666] Fri, 19 June 2009 01:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.windstream.net

Andreas,

You may want to log an enhancement request for this. Is you
implementation done in its own plugin or are you using one of the
defaults? As a work around you call call your plugin directly from
script/expression.

For example to access the viewer plugin:
importPackage(Packages.org.eclipse.core.runtime);

//importPackage(Packages.org.eclipse.birt.report.viewer);

mybundle = Platform.getBundle("org.eclipse.birt.report.viewer");
mc = mybundle.loadClass(
"org.eclipse.birt.report.viewer.utilities.WebViewer");
mi = mc.newInstance();
xyz = mi.getCurrentWebApp().getName();

Jason

Andreas Mayer wrote:
> Hello,
>
> I want to call a particular method in one of my data sources from a
> script or an expression in the report. However, "this" in the
> corresponding scripts refers to a JSDataSourceImpl or JSDataSetImpl and
> there seems to be no way to obtain the actual implementation of
> IConnection or IQuery from there.
>
> How can I get access to the actual data source or data set
> implementation to call one of its methods?
Re: How to call methods of a data source or data set from a script or expression? [message #368877 is a reply to message #368696] Thu, 02 July 2009 13:52 Go to previous message
Eclipse UserFriend
Originally posted by: an.ma.web.de

Jason Weathersby wrote:

> You may want to log an enhancement request for this. Is you
> implementation done in its own plugin or are you using one of the
> defaults?

It's one of my own.

> As a work around you call call your plugin directly from
> script/expression.
>
> For example to access the viewer plugin:
> importPackage(Packages.org.eclipse.core.runtime);
>
> //importPackage(Packages.org.eclipse.birt.report.viewer);
>
> mybundle = Platform.getBundle("org.eclipse.birt.report.viewer");
> mc = mybundle.loadClass(
> "org.eclipse.birt.report.viewer.utilities.WebViewer");
> mi = mc.newInstance();
> xyz = mi.getCurrentWebApp().getName();

Okay. But I would like to access an already existing object, namely the
runtime instance of a data source defined in the report design. That
data source holds a large data structure (several MBs). Now I would like
to re-use that data structure in additional scripted data sources, but I
don't know how to access it. The scripted data source could obtain its
own copy of this data structure, wasting a lot of memory and CPU time.
--
Andreas
Previous Topic:Datatype "Any" in 2.3.2
Next Topic:Problem in chart with datatime
Goto Forum:
  


Current Time: Thu Apr 25 03:54:55 GMT 2024

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

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

Back to the top