Home » Archived » BIRT » rcp + birt engine
rcp + birt engine [message #156724] |
Thu, 27 April 2006 12:16 |
Eclipse User |
|
|
|
Originally posted by: em.microcraft.se
Hi,
First I like to thank the BIRT team for the great tools you put in our
hands!
We have already integrated the report engine i our web-applications and
now we are taking the next step.
We are trying to integrate the engine part of birt in our existing
rcp-application. At this date we don't want the designer and viewer,
only the engine so we can generate html and pdf-reports from existing
report design files (.rptdesign).
Our first approach would be to just add the birt-runtime-2_0_1/Report
Engine to the plugin that needs to generate reports.
We have a problem with that approach because we believe that it should
be possible to just add dependencies on the required plugins (everything
is plugins i eclipse, why add the report engine as something else?).
This would probably make it easier to perform updates in future because
we don't have to distribute the birt report-engine within the plugin
that is using it.
So after reading a bit about the plugings that BIRT consists of and what
dependencies they have to each other I ended up adding the following
plugins to our rcp application target:
org.eclipse.birt.core_2.0.1
org.eclipse.birt.data.oda_2.0.2
org.eclipse.birt.data_2.0.1
org.eclipse.birt.report.engine.emitter.html_2.0.1
org.eclipse.birt.report.engine.emitter.pdf_2.0.1
org.eclipse.birt.report.engine_2.0.1
org.eclipse.birt.report.model_2.0.1
org.eclipse.datatools.connectivity.oda_3.0.0
org.junit_3.8.1
....and I added dependencies on these plugins in the plugin that will be
responsible for generating reports.
We use a scripted data source in our reports and when I try to execute a
report, Birt don't seem to know about my java-classes (see log below).
How can I solve this classloadning problem? (if it is a class loading
problem...) And last but not least do you think it is possible to
integrate BIRT the way I'm trying to do? Or should I give up and go back
to the thread "Re: Integrate Birt in RCP" from 2006-03-24 and follow the
steps there despite i dislike to integrate birt in that way?
Ideas?
Best regards
Erik Mellegård
Part of log when running report:
FINARE: Start to execute
2006-apr-26 16:51:56 org.eclipse.birt.data.engine.script.ScriptEvalUtil
evaluateJSExpr
FINARE: ENTRY evaluateJSExpr() scriptText=function __bm_OPEN() {
//Initialize the report
var orderLocal;
var language;
var srvurl;
if(typeof support == 'undefined'){
//Preview mode. this section will not run on the web-server. This
will run in the RCP-app
garp =
Packages.com.garp.utils.InitialReference.getInitialReference ( "127.0.0.1",4444);
user = garp.getUser("XXX","");
factory = user.getB2BBaseFactory();
b2buser = factory.getUserInBolag("100","007","100","100");
orderLocal = b2buser.order();
language=" ";
//for images
srvurl="http://127.0.0.1:8080/b2b";
} else {
//Web-server mode. This is what is running on the web-server
orderLocal = support.order;
language=session.getAttribute("language");
srvurl =
"http://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath();
}
order=orderLocal;
serverurl=srvurl;
lang=language;
onr = params['onr'];
oc = order.getOrderConfirm(onr);
odi = order.getOrderDetails(onr);
nf = new Packages.com.garp.www.NumberFormat();
lh = new Packages.com.garp.www.LangHandler();
i = odi.length;
count = 0;
} , source=DataSet[garpOrderconfirm].__bm_OPEN, lineNo=1
2006-apr-26 16:51:56 org.eclipse.birt.data.engine.script.ScriptEvalUtil
evaluateJSExpr
FINARE: ENTRY evaluateJSExpr() scriptText=__bm_OPEN(),
source=DataSet[garpOrderconfirm].__bm_OPEN, lineNo=1
2006-apr-26 16:51:56 org.eclipse.birt.core.script.JavascriptEvalUtil
wrapRhinoException
FIN: Unexpected RhinoException.
Source=DataSet[garpOrderconfirm].__bm_OPEN, line=1, Script=
__bm_OPEN()
org.mozilla.javascript.EcmaError: TypeError: getInitialReference is not
a function. (DataSet[garpOrderconfirm].__bm_OPEN#8)
at
org.mozilla.javascript.ScriptRuntime.constructError(ScriptRu ntime.java:3240)
at
org.mozilla.javascript.ScriptRuntime.constructError(ScriptRu ntime.java:3230)
at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime .java:3246)
at org.mozilla.javascript.ScriptRuntime.typeError1(ScriptRuntim e.java:3258)
at
org.mozilla.javascript.ScriptRuntime.notFunctionError(Script Runtime.java:3317)
at
org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThis( ScriptRuntime.java:1987)
at org.mozilla.javascript.gen.c6._c1(DataSet[garpOrderconfirm]. __bm_OPEN:8)
at org.mozilla.javascript.gen.c6.call(DataSet[garpOrderconfirm] .__bm_OPEN)
at
org.mozilla.javascript.optimizer.OptRuntime.callName0(OptRun time.java:105)
at org.mozilla.javascript.gen.c5._c0(DataSource[garpSource].__b m_OPEN:1)
at org.mozilla.javascript.gen.c5.call(DataSource[garpSource].__ bm_OPEN)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFacto ry.java:304)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime .java:2769)
at org.mozilla.javascript.gen.c5.call(DataSource[garpSource].__ bm_OPEN)
at org.mozilla.javascript.gen.c5.exec(DataSource[garpSource].__ bm_OPEN)
at
org.eclipse.birt.core.script.JavascriptEvalUtil.evaluateScri pt(JavascriptEvalUtil.java:86)
at
org.eclipse.birt.data.engine.script.ScriptEvalUtil.evaluateJ SAsExpr(ScriptEvalUtil.java:527)
at
org.eclipse.birt.data.engine.script.JSMethodRunner.runScript (JSMethodRunner.java:79)
at
org.eclipse.birt.report.engine.script.internal.DtEScriptExec utor.handleJS(DtEScriptExecutor.java:71)
at
org.eclipse.birt.report.engine.script.internal.DataSetScript Executor.handleJS(DataSetScriptExecutor.java:159)
at
org.eclipse.birt.report.engine.script.internal.ScriptDataSet ScriptExecutor.handleOpen(ScriptDataSetScriptExecutor.java:6 6)
at
org.eclipse.birt.data.engine.impl.ScriptDataSetRuntime.open( ScriptDataSetRuntime.java:68)
at
org.eclipse.birt.data.engine.impl.PreparedScriptDSQuery$Scri ptDSQueryExecutor$CustomDataSet.open(PreparedScriptDSQuery.j ava:204)
at
org.eclipse.birt.data.engine.impl.PreparedScriptDSQuery$Scri ptDSQueryExecutor.executeOdiQuery(PreparedScriptDSQuery.java :180)
at
org.eclipse.birt.data.engine.impl.PreparedQuery$Executor.exe cute(PreparedQuery.java:711)
at
org.eclipse.birt.data.engine.impl.QueryResults.getResultIter ator(QueryResults.java:110)
at
org.eclipse.birt.report.engine.data.dte.DteDataEngine.execut e(DteDataEngine.java:210)
at
org.eclipse.birt.report.engine.executor.QueryItemExecutor.op enResultSet(QueryItemExecutor.java:62)
at
org.eclipse.birt.report.engine.executor.GridItemExecutor.exe cute(GridItemExecutor.java:82)
at
org.eclipse.birt.report.engine.executor.ReportExecutorVisito r.visitGridItem(ReportExecutorVisitor.java:172)
at
org.eclipse.birt.report.engine.ir.GridItemDesign.accept(Grid ItemDesign.java:117)
at
org.eclipse.birt.report.engine.executor.ReportExecutor.execu te(ReportExecutor.java:125)
at
org.eclipse.birt.report.engine.executor.ReportExecutor.execu te(ReportExecutor.java:89)
at
org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:175)
at com.garp.b2soffline.birt.BirtReport.generateReport(BirtRepor t.java:76)
at
com.garp.b2soffline.ui.action.CreateBirtReportAction.run(Cre ateBirtReportAction.java:19)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:996 )
at
org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:538)
at
org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:488)
at
org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:400)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3125)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2758)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1699)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:367)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:143)
at
com.garp.b2soffline.product.workbench.B2SApplication.run(B2S Application.java:27)
at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:226)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:376)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:163)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334 )
at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
at org.eclipse.core.launcher.Main.run(Main.java:973)
at org.eclipse.core.launcher.Main.main(Main.java:948)
|
|
|
Re: rcp + birt engine [message #156799 is a reply to message #156724] |
Thu, 27 April 2006 15:24 |
|
Erik,
I havent tried it this way. I normally just add the RE jars to my RCP
application.
That said I would think that this would work. Have you tried adding a class
folder to the application (using the Build Path) and putting your pojo
there? Using this method where you able to run a report off the sampledb?
Thanks
Jason
"Erik Melleg
|
|
|
Re: rcp + birt engine [message #157136 is a reply to message #156799] |
Fri, 28 April 2006 13:53 |
Eclipse User |
|
|
|
Originally posted by: em.microcraft.se
Hi,
Thank you for your rapid reply.
Now I have tested to generate a report from a design using the
sample-db. It worked perfectly after adding the two following plugins:
org.eclipse.birt.report.data.oda.jdbc_2.0.1
org.eclipse.birt.report.data.oda.sampledb_2.0.1
From this I draw the conclusion that it is possible to use the birt
engine this way, which I feel good about.
My problem with the scripted datasource still exists though.
I have tried to add my POJO-jar-file to the build classpath with no
successs.
I also tried to register my plugin (which contains my POJOs) as a
"Buddy" to org.eclipse.birt.report.engine. by adding the following line
to my plugin manifest file
Eclipse-RegisterBuddy: org.eclipse.birt.report.engine
Other ideas? How can i tell the report engine class loader to look for
the classes in my plugin?
Best regards
Erik
Jason Weathersby wrote:
> Erik,
>
> I havent tried it this way. I normally just add the RE jars to my RCP
> application.
> That said I would think that this would work. Have you tried adding a class
> folder to the application (using the Build Path) and putting your pojo
> there? Using this method where you able to run a report off the sampledb?
>
> Thanks
>
> Jason
>
> "Erik Mellegård" <em@microcraft.se> wrote in message
> news:e2qcnr$b6f$1@utils.eclipse.org...
>
>>Hi,
>>First I like to thank the BIRT team for the great tools you put in our
>>hands!
>>We have already integrated the report engine i our web-applications and
>>now we are taking the next step.
>>
>>We are trying to integrate the engine part of birt in our existing
>>rcp-application. At this date we don't want the designer and viewer, only
>>the engine so we can generate html and pdf-reports from existing report
>>design files (.rptdesign).
>>
>>Our first approach would be to just add the birt-runtime-2_0_1/Report
>>Engine to the plugin that needs to generate reports.
>>
>>We have a problem with that approach because we believe that it should be
>>possible to just add dependencies on the required plugins (everything is
>>plugins i eclipse, why add the report engine as something else?). This
>>would probably make it easier to perform updates in future because we
>>don't have to distribute the birt report-engine within the plugin that is
>>using it.
>>
>>So after reading a bit about the plugings that BIRT consists of and what
>>dependencies they have to each other I ended up adding the following
>>plugins to our rcp application target:
>>
>>org.eclipse.birt.core_2.0.1
>>org.eclipse.birt.data.oda_2.0.2
>>org.eclipse.birt.data_2.0.1
>>org.eclipse.birt.report.engine.emitter.html_2.0.1
>>org.eclipse.birt.report.engine.emitter.pdf_2.0.1
>>org.eclipse.birt.report.engine_2.0.1
>>org.eclipse.birt.report.model_2.0.1
>>org.eclipse.datatools.connectivity.oda_3.0.0
>>org.junit_3.8.1
>>
>>...and I added dependencies on these plugins in the plugin that will be
>>responsible for generating reports.
>>
>>We use a scripted data source in our reports and when I try to execute a
>>report, Birt don't seem to know about my java-classes (see log below). How
>>can I solve this classloadning problem? (if it is a class loading
>>problem...) And last but not least do you think it is possible to
>>integrate BIRT the way I'm trying to do? Or should I give up and go back
>>to the thread "Re: Integrate Birt in RCP" from 2006-03-24 and follow the
>>steps there despite i dislike to integrate birt in that way?
>>
>>Ideas?
>>
>>Best regards
>>Erik Mellegård
>>
>>Part of log when running report:
>>
>>FINARE: Start to execute
>>2006-apr-26 16:51:56 org.eclipse.birt.data.engine.script.ScriptEvalUtil
>>evaluateJSExpr
>>FINARE: ENTRY evaluateJSExpr() scriptText=function __bm_OPEN() {
>>//Initialize the report
>>var orderLocal;
>>var language;
>>var srvurl;
>>if(typeof support == 'undefined'){
>> //Preview mode. this section will not run on the web-server. This will
>>run in the RCP-app
>> garp =
>> Packages.com.garp.utils.InitialReference.getInitialReference ( "127.0.0.1",4444);
>> user = garp.getUser("XXX","");
>>
>> factory = user.getB2BBaseFactory();
>> b2buser = factory.getUserInBolag("100","007","100","100");
>> orderLocal = b2buser.order();
>> language=" ";
>> //for images
>> srvurl="http://127.0.0.1:8080/b2b";
>>} else {
>> //Web-server mode. This is what is running on the web-server
>> orderLocal = support.order;
>> language=session.getAttribute("language");
>> srvurl =
>>"http://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath();
>>}
>>order=orderLocal;
>>serverurl=srvurl;
>>lang=language;
>>onr = params['onr'];
>>oc = order.getOrderConfirm(onr);
>>odi = order.getOrderDetails(onr);
>>nf = new Packages.com.garp.www.NumberFormat();
>>lh = new Packages.com.garp.www.LangHandler();
>>i = odi.length;
>>count = 0;
>>} , source=DataSet[garpOrderconfirm].__bm_OPEN, lineNo=1
>>2006-apr-26 16:51:56 org.eclipse.birt.data.engine.script.ScriptEvalUtil
>>evaluateJSExpr
>>FINARE: ENTRY evaluateJSExpr() scriptText=__bm_OPEN(),
>>source=DataSet[garpOrderconfirm].__bm_OPEN, lineNo=1
>>2006-apr-26 16:51:56 org.eclipse.birt.core.script.JavascriptEvalUtil
>>wrapRhinoException
>>FIN: Unexpected RhinoException.
>>Source=DataSet[garpOrderconfirm].__bm_OPEN, line=1, Script=
>>__bm_OPEN()
>>
>>org.mozilla.javascript.EcmaError: TypeError: getInitialReference is not a
>>function. (DataSet[garpOrderconfirm].__bm_OPEN#8)
>>at
>> org.mozilla.javascript.ScriptRuntime.constructError(ScriptRu ntime.java:3240)
>>at
>> org.mozilla.javascript.ScriptRuntime.constructError(ScriptRu ntime.java:3230)
>>at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime .java:3246)
>>at
>> org.mozilla.javascript.ScriptRuntime.typeError1(ScriptRuntim e.java:3258)
>>at
>> org.mozilla.javascript.ScriptRuntime.notFunctionError(Script Runtime.java:3317)
>>at
>> org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThis( ScriptRuntime.java:1987)
>>at
>> org.mozilla.javascript.gen.c6._c1(DataSet[garpOrderconfirm]. __bm_OPEN:8)
>>at org.mozilla.javascript.gen.c6.call(DataSet[garpOrderconfirm] .__bm_OPEN)
>>at
>> org.mozilla.javascript.optimizer.OptRuntime.callName0(OptRun time.java:105)
>>at org.mozilla.javascript.gen.c5._c0(DataSource[garpSource].__b m_OPEN:1)
>>at org.mozilla.javascript.gen.c5.call(DataSource[garpSource].__ bm_OPEN)
>>at
>> org.mozilla.javascript.ContextFactory.doTopCall(ContextFacto ry.java:304)
>>at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime .java:2769)
>>at org.mozilla.javascript.gen.c5.call(DataSource[garpSource].__ bm_OPEN)
>>at org.mozilla.javascript.gen.c5.exec(DataSource[garpSource].__ bm_OPEN)
>>at
>> org.eclipse.birt.core.script.JavascriptEvalUtil.evaluateScri pt(JavascriptEvalUtil.java:86)
>>at
>> org.eclipse.birt.data.engine.script.ScriptEvalUtil.evaluateJ SAsExpr(ScriptEvalUtil.java:527)
>>at
>> org.eclipse.birt.data.engine.script.JSMethodRunner.runScript (JSMethodRunner.java:79)
>>at
>> org.eclipse.birt.report.engine.script.internal.DtEScriptExec utor.handleJS(DtEScriptExecutor.java:71)
>>at
>> org.eclipse.birt.report.engine.script.internal.DataSetScript Executor.handleJS(DataSetScriptExecutor.java:159)
>>at
>> org.eclipse.birt.report.engine.script.internal.ScriptDataSet ScriptExecutor.handleOpen(ScriptDataSetScriptExecutor.java:6 6)
>>at
>> org.eclipse.birt.data.engine.impl.ScriptDataSetRuntime.open( ScriptDataSetRuntime.java:68)
>>at
>> org.eclipse.birt.data.engine.impl.PreparedScriptDSQuery$Scri ptDSQueryExecutor$CustomDataSet.open(PreparedScriptDSQuery.j ava:204)
>>at
>> org.eclipse.birt.data.engine.impl.PreparedScriptDSQuery$Scri ptDSQueryExecutor.executeOdiQuery(PreparedScriptDSQuery.java :180)
>>at
>> org.eclipse.birt.data.engine.impl.PreparedQuery$Executor.exe cute(PreparedQuery.java:711)
>>at
>> org.eclipse.birt.data.engine.impl.QueryResults.getResultIter ator(QueryResults.java:110)
>>at
>> org.eclipse.birt.report.engine.data.dte.DteDataEngine.execut e(DteDataEngine.java:210)
>>at
>> org.eclipse.birt.report.engine.executor.QueryItemExecutor.op enResultSet(QueryItemExecutor.java:62)
>>at
>> org.eclipse.birt.report.engine.executor.GridItemExecutor.exe cute(GridItemExecutor.java:82)
>>at
>> org.eclipse.birt.report.engine.executor.ReportExecutorVisito r.visitGridItem(ReportExecutorVisitor.java:172)
>>at
>> org.eclipse.birt.report.engine.ir.GridItemDesign.accept(Grid ItemDesign.java:117)
>>at
>> org.eclipse.birt.report.engine.executor.ReportExecutor.execu te(ReportExecutor.java:125)
>>at
>> org.eclipse.birt.report.engine.executor.ReportExecutor.execu te(ReportExecutor.java:89)
>>at
>> org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:175)
>>at com.garp.b2soffline.birt.BirtReport.generateReport(BirtRepor t.java:76)
>>at
>> com.garp.b2soffline.ui.action.CreateBirtReportAction.run(Cre ateBirtReportAction.java:19)
>>at org.eclipse.jface.action.Action.runWithEvent(Action.java:996 )
>>at
>> org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:538)
>>at
>> org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:488)
>>at
>> org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:400)
>>at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
>>at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843)
>>at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3125)
>>at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2758)
>>at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1699)
>>at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
>>at
>> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:367)
>>at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:143)
>>at
>> com.garp.b2soffline.product.workbench.B2SApplication.run(B2S Application.java:27)
>>at
>> org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:226)
>>at
>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:376)
>>at
>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:163)
>>at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>at java.lang.reflect.Method.invoke(Unknown Source)
>>at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334 )
>>at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
>>at org.eclipse.core.launcher.Main.run(Main.java:973)
>>at org.eclipse.core.launcher.Main.main(Main.java:948)
>
>
>
|
|
|
Re: rcp + birt engine [message #157181 is a reply to message #157136] |
Fri, 28 April 2006 14:55 |
|
Erik,
I got this to work with my example by creating a classes directory in my
project.
I uploaded my POJO and then on the Runtime tab of my plugin added the folder
to the Classpath.
Jason
"Erik Melleg
|
|
|
Re: rcp + birt engine [message #157990 is a reply to message #157181] |
Wed, 03 May 2006 11:41 |
Eclipse User |
|
|
|
Originally posted by: em.microcraft.se
Hi,
I guess that the problem was that my POJOs were embedded inside a
jar-file that made them invisible in some way to the BIRT script
runtime. I solved the problem by adding my factory object as a
ScriptableJavaObject to the task before calling task.run(). Now the
report nows about my classes.
Thanks again for your rapid replies.
/Erik
Jason Weathersby wrote:
> Erik,
>
> I got this to work with my example by creating a classes directory in my
> project.
> I uploaded my POJO and then on the Runtime tab of my plugin added the folder
> to the Classpath.
>
> Jason
>
> "Erik Mellegård" <em@microcraft.se> wrote in message
> news:e2t6oc$tts$1@utils.eclipse.org...
>
>>Hi,
>>
>>Thank you for your rapid reply.
>>
>>Now I have tested to generate a report from a design using the sample-db.
>>It worked perfectly after adding the two following plugins:
>>org.eclipse.birt.report.data.oda.jdbc_2.0.1
>>org.eclipse.birt.report.data.oda.sampledb_2.0.1
>>
>>From this I draw the conclusion that it is possible to use the birt engine
>>this way, which I feel good about.
>>
>>My problem with the scripted datasource still exists though.
>>
>>I have tried to add my POJO-jar-file to the build classpath with no
>>successs.
>>
>>I also tried to register my plugin (which contains my POJOs) as a "Buddy"
>>to org.eclipse.birt.report.engine. by adding the following line to my
>>plugin manifest file
>>Eclipse-RegisterBuddy: org.eclipse.birt.report.engine
>>
>>Other ideas? How can i tell the report engine class loader to look for the
>>classes in my plugin?
>>
>>Best regards
>>Erik
>>
>>Jason Weathersby wrote:
>>
>>>Erik,
>>>
>>>I havent tried it this way. I normally just add the RE jars to my RCP
>>>application.
>>>That said I would think that this would work. Have you tried adding a
>>>class folder to the application (using the Build Path) and putting your
>>>pojo there? Using this method where you able to run a report off the
>>>sampledb?
>>>
>>>Thanks
>>>
>>>Jason
>>>
>>>"Erik Mellegård" <em@microcraft.se> wrote in message
>>>news:e2qcnr$b6f$1@utils.eclipse.org...
>>>
>>>
>>>>Hi,
>>>>First I like to thank the BIRT team for the great tools you put in our
>>>>hands!
>>>>We have already integrated the report engine i our web-applications and
>>>>now we are taking the next step.
>>>>
>>>>We are trying to integrate the engine part of birt in our existing
>>>>rcp-application. At this date we don't want the designer and viewer, only
>>>>the engine so we can generate html and pdf-reports from existing report
>>>>design files (.rptdesign).
>>>>
>>>>Our first approach would be to just add the birt-runtime-2_0_1/Report
>>>>Engine to the plugin that needs to generate reports.
>>>>
>>>>We have a problem with that approach because we believe that it should be
>>>>possible to just add dependencies on the required plugins (everything is
>>>>plugins i eclipse, why add the report engine as something else?). This
>>>>would probably make it easier to perform updates in future because we
>>>>don't have to distribute the birt report-engine within the plugin that is
>>>>using it.
>>>>
>>>>So after reading a bit about the plugings that BIRT consists of and what
>>>>dependencies they have to each other I ended up adding the following
>>>>plugins to our rcp application target:
>>>>
>>>>org.eclipse.birt.core_2.0.1
>>>>org.eclipse.birt.data.oda_2.0.2
>>>>org.eclipse.birt.data_2.0.1
>>>>org.eclipse.birt.report.engine.emitter.html_2.0.1
>>>>org.eclipse.birt.report.engine.emitter.pdf_2.0.1
>>>>org.eclipse.birt.report.engine_2.0.1
>>>>org.eclipse.birt.report.model_2.0.1
>>>>org.eclipse.datatools.connectivity.oda_3.0.0
>>>>org.junit_3.8.1
>>>>
>>>>...and I added dependencies on these plugins in the plugin that will be
>>>>responsible for generating reports.
>>>>
>>>>We use a scripted data source in our reports and when I try to execute a
>>>>report, Birt don't seem to know about my java-classes (see log below).
>>>>How can I solve this classloadning problem? (if it is a class loading
>>>>problem...) And last but not least do you think it is possible to
>>>>integrate BIRT the way I'm trying to do? Or should I give up and go back
>>>>to the thread "Re: Integrate Birt in RCP" from 2006-03-24 and follow the
>>>>steps there despite i dislike to integrate birt in that way?
>>>>
>>>>Ideas?
>>>>
>>>>Best regards
>>>>Erik Mellegård
>>>>
>>>>Part of log when running report:
>>>>
>>>>FINARE: Start to execute
>>>>2006-apr-26 16:51:56 org.eclipse.birt.data.engine.script.ScriptEvalUtil
>>>>evaluateJSExpr
>>>>FINARE: ENTRY evaluateJSExpr() scriptText=function __bm_OPEN() {
>>>>//Initialize the report
>>>>var orderLocal;
>>>>var language;
>>>>var srvurl;
>>>>if(typeof support == 'undefined'){
>>>> //Preview mode. this section will not run on the web-server. This will
>>>>run in the RCP-app
>>>> garp =
>>>> Packages.com.garp.utils.InitialReference.getInitialReference ( "127.0.0.1",4444);
>>>> user = garp.getUser("XXX","");
>>>>
>>>> factory = user.getB2BBaseFactory();
>>>> b2buser = factory.getUserInBolag("100","007","100","100");
>>>> orderLocal = b2buser.order();
>>>> language=" ";
>>>> //for images
>>>> srvurl="http://127.0.0.1:8080/b2b";
>>>>} else {
>>>> //Web-server mode. This is what is running on the web-server
>>>> orderLocal = support.order;
>>>> language=session.getAttribute("language");
>>>> srvurl =
>>>>"http://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath();
>>>>}
>>>>order=orderLocal;
>>>>serverurl=srvurl;
>>>>lang=language;
>>>>onr = params['onr'];
>>>>oc = order.getOrderConfirm(onr);
>>>>odi = order.getOrderDetails(onr);
>>>>nf = new Packages.com.garp.www.NumberFormat();
>>>>lh = new Packages.com.garp.www.LangHandler();
>>>>i = odi.length;
>>>>count = 0;
>>>>} , source=DataSet[garpOrderconfirm].__bm_OPEN, lineNo=1
>>>>2006-apr-26 16:51:56 org.eclipse.birt.data.engine.script.ScriptEvalUtil
>>>>evaluateJSExpr
>>>>FINARE: ENTRY evaluateJSExpr() scriptText=__bm_OPEN(),
>>>>source=DataSet[garpOrderconfirm].__bm_OPEN, lineNo=1
>>>>2006-apr-26 16:51:56 org.eclipse.birt.core.script.JavascriptEvalUtil
>>>>wrapRhinoException
>>>>FIN: Unexpected RhinoException.
>>>>Source=DataSet[garpOrderconfirm].__bm_OPEN, line=1, Script=
>>>>__bm_OPEN()
>>>>
>>>>org.mozilla.javascript.EcmaError: TypeError: getInitialReference is not a
>>>>function. (DataSet[garpOrderconfirm].__bm_OPEN#8)
>>>>at
>>>> org.mozilla.javascript.ScriptRuntime.constructError(ScriptRu ntime.java:3240)
>>>>at
>>>> org.mozilla.javascript.ScriptRuntime.constructError(ScriptRu ntime.java:3230)
>>>>at
>>>> org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime .java:3246)
>>>>at
>>>> org.mozilla.javascript.ScriptRuntime.typeError1(ScriptRuntim e.java:3258)
>>>>at
>>>> org.mozilla.javascript.ScriptRuntime.notFunctionError(Script Runtime.java:3317)
>>>>at
>>>> org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThis( ScriptRuntime.java:1987)
>>>>at
>>>> org.mozilla.javascript.gen.c6._c1(DataSet[garpOrderconfirm]. __bm_OPEN:8)
>>>>at
>>>> org.mozilla.javascript.gen.c6.call(DataSet[garpOrderconfirm] .__bm_OPEN)
>>>>at
>>>> org.mozilla.javascript.optimizer.OptRuntime.callName0(OptRun time.java:105)
>>>>at org.mozilla.javascript.gen.c5._c0(DataSource[garpSource].__b m_OPEN:1)
>>>>at org.mozilla.javascript.gen.c5.call(DataSource[garpSource].__ bm_OPEN)
>>>>at
>>>> org.mozilla.javascript.ContextFactory.doTopCall(ContextFacto ry.java:304)
>>>>at
>>>> org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime .java:2769)
>>>>at org.mozilla.javascript.gen.c5.call(DataSource[garpSource].__ bm_OPEN)
>>>>at org.mozilla.javascript.gen.c5.exec(DataSource[garpSource].__ bm_OPEN)
>>>>at
>>>> org.eclipse.birt.core.script.JavascriptEvalUtil.evaluateScri pt(JavascriptEvalUtil.java:86)
>>>>at
>>>> org.eclipse.birt.data.engine.script.ScriptEvalUtil.evaluateJ SAsExpr(ScriptEvalUtil.java:527)
>>>>at
>>>> org.eclipse.birt.data.engine.script.JSMethodRunner.runScript (JSMethodRunner.java:79)
>>>>at
>>>> org.eclipse.birt.report.engine.script.internal.DtEScriptExec utor.handleJS(DtEScriptExecutor.java:71)
>>>>at
>>>> org.eclipse.birt.report.engine.script.internal.DataSetScript Executor.handleJS(DataSetScriptExecutor.java:159)
>>>>at
>>>> org.eclipse.birt.report.engine.script.internal.ScriptDataSet ScriptExecutor.handleOpen(ScriptDataSetScriptExecutor.java:6 6)
>>>>at
>>>> org.eclipse.birt.data.engine.impl.ScriptDataSetRuntime.open( ScriptDataSetRuntime.java:68)
>>>>at
>>>> org.eclipse.birt.data.engine.impl.PreparedScriptDSQuery$Scri ptDSQueryExecutor$CustomDataSet.open(PreparedScriptDSQuery.j ava:204)
>>>>at
>>>> org.eclipse.birt.data.engine.impl.PreparedScriptDSQuery$Scri ptDSQueryExecutor.executeOdiQuery(PreparedScriptDSQuery.java :180)
>>>>at
>>>> org.eclipse.birt.data.engine.impl.PreparedQuery$Executor.exe cute(PreparedQuery.java:711)
>>>>at
>>>> org.eclipse.birt.data.engine.impl.QueryResults.getResultIter ator(QueryResults.java:110)
>>>>at
>>>> org.eclipse.birt.report.engine.data.dte.DteDataEngine.execut e(DteDataEngine.java:210)
>>>>at
>>>> org.eclipse.birt.report.engine.executor.QueryItemExecutor.op enResultSet(QueryItemExecutor.java:62)
>>>>at
>>>> org.eclipse.birt.report.engine.executor.GridItemExecutor.exe cute(GridItemExecutor.java:82)
>>>>at
>>>> org.eclipse.birt.report.engine.executor.ReportExecutorVisito r.visitGridItem(ReportExecutorVisitor.java:172)
>>>>at
>>>> org.eclipse.birt.report.engine.ir.GridItemDesign.accept(Grid ItemDesign.java:117)
>>>>at
>>>> org.eclipse.birt.report.engine.executor.ReportExecutor.execu te(ReportExecutor.java:125)
>>>>at
>>>> org.eclipse.birt.report.engine.executor.ReportExecutor.execu te(ReportExecutor.java:89)
>>>>at
>>>> org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:175)
>>>>at com.garp.b2soffline.birt.BirtReport.generateReport(BirtRepor t.java:76)
>>>>at
>>>> com.garp.b2soffline.ui.action.CreateBirtReportAction.run(Cre ateBirtReportAction.java:19)
>>>>at org.eclipse.jface.action.Action.runWithEvent(Action.java:996 )
>>>>at
>>>> org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:538)
>>>>at
>>>> org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:488)
>>>>at
>>>> org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:400)
>>>>at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
>>>>at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843)
>>>>at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3125)
>>>>at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2758)
>>>>at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1699)
>>>>at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
>>>>at
>>>> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:367)
>>>>at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:143)
>>>>at
>>>> com.garp.b2soffline.product.workbench.B2SApplication.run(B2S Application.java:27)
>>>>at
>>>> org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:226)
>>>>at
>>>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:376)
>>>>at
>>>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:163)
>>>>at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>>>at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>>>at java.lang.reflect.Method.invoke(Unknown Source)
>>>>at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334 )
>>>>at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
>>>>at org.eclipse.core.launcher.Main.run(Main.java:973)
>>>>at org.eclipse.core.launcher.Main.main(Main.java:948)
>>>
>>>
>
|
|
|
Goto Forum:
Current Time: Fri Dec 27 03:50:53 GMT 2024
Powered by FUDForum. Page generated in 0.03592 seconds
|