Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Scripted Datasource inside Eclipse RCP application
Scripted Datasource inside Eclipse RCP application [message #366430] Mon, 29 December 2008 11:05
Doménique Tilleuil is currently offline Doménique Tilleuil
Messages: 4
Registered: July 2009
Junior Member
Hi,

I'm trying to run a report inside an RCP application that using a scripted
Datasource.

First of all, this is how my application looks like :

Plugin
|-> /rpt
|--> offerteReport.rptdesign
|->bin
|--> be/dewaal.offertes/report/OfferteFactory.class

When I run the report, I get the following error :

....
TypeError: [JavaPackage be.dewaal.offertes.report.OfferteFactory] is not a
function, it is org.mozilla.javascript.NativeJavaPackage. (#2). at
org.eclipse.birt.data.engine.core.DataException.wrap(DataExc eption.java:118)
at
org.eclipse.birt.data.engine.script.ScriptEvalUtil.evaluateJ SAsExpr(ScriptEvalUtil.java:717)
at
org.eclipse.birt.data.engine.script.JSMethodRunner.runScript (JSMethodRunner.java:76)
at
org.eclipse.birt.report.engine.script.internal.DtEScriptExec utor.handleJS(DtEScriptExecutor.java:71)...
87 more
...

This error makes me believe that he can't find the ObjectFactory class in
the classpath of the jetty server instance he started to create the
report.

Below is the code snippet I use to display the report inside an Editor :

public void createPartControl(Composite parent) {
Composite container = new Composite(parent, 0);
container.setLayout(new FillLayout());
Browser browser = new Browser(container, 0);
org.osgi.framework.Bundle bundle = Platform.getBundle("deWaalOffertes");
URL locationUrl = FileLocator.find(bundle, new Path(
"/rpt/offerteReport.rptdesign"), null);
URL fileUrl = null;
try {
fileUrl = FileLocator.toFileURL(locationUrl);
} catch (IOException e1) {
e1.printStackTrace();
}
WebViewer.startup(browser);
String format = "html";
String preParameters = createURL("frameset", fileUrl.getFile(), format);
String parm1NameString = null;
String parm1ValueString = null;
try {
parm1NameString = URLEncoder.encode("offerteID", "utf-8");
parm1ValueString = URLEncoder.encode("1", "utf-8");
} catch (UnsupportedEncodingException e) {
Activator.logError("Fout tijdens het tonen van het rapport.", e);
}


String finalUrl = (new StringBuilder(String.valueOf(preParameters)))
.append("&").append(parm1NameString).append("=").append(
parm1ValueString).toString();
browser.setUrl(finalUrl);
}

I would like to know how I can make the report viewer use the correct
classpath so that it finds my Factory class for creating the reports.


Krgds
Previous Topic:Installing BIRT after DTP - connection profiles lost?
Next Topic:How to add html attribute in BIRT
Goto Forum:
  


Current Time: Fri May 24 15:04:15 EDT 2013

Powered by FUDForum. Page generated in 0.01462 seconds