How to call methods of a data source or data set from a script or expression? [message #368666] |
Thu, 18 June 2009 09:00 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.03492 seconds