Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Import ReportDesign with Java into BirtEngine
Phill
Hello,
i have created my reports with java classes (own classes to generate some static information) with eclipse and the preview run without any problems.
I start the Birt Engine with my java server and open die rptDesign, but a error occurs because, he can't find the java classes of my report.
Now the question:
how i can export my java classes into the birtEngine?
I had read something like, that i should export my whole reportProject into a *.jar file, and copy it to the "lib" folder in the birt engine.
Or what have i to do?!
thanks
Find more posts tagged with
Comments
JasonW
Are the java classes called by birt? What version of BIRT are you using?
Jason
Phill
Hello,
in my created Report, i use the my java classes in expressions etc.
I'm using the verison 3.7.
(The Eclipse is in 3.7 and my Birt engine for my java server is 3.7 too)
e.g.
var mainStaff = new Packages.staff.Staff();
And "Staff()" is my java class in the package "Staff".
I found some Topics about this way to use Java in reports, but i don't find anything how i can
get it to works in the birt engine.
If i start a report with my server, is call the report directly atm.
thanks
JasonW
In the BIRT runtime with 3.7, using the RE API or the Viewer your classes just need to be in the classpath. Eg WebViewer/web-inf/lib or RE API anywhere in the classpath.
Jason
Phill
Hello,
thanks for your fast answer.
But i dont understand exactly.
I have my *.rptdesign file with my report which use the file "staff.java"
Where i have to copy these files?
Should i copy the java file directly in the classpath or should i export the project to a jar file and
copy it to the classpath?
thanks
JasonW
Export the classes to a jar file and add it to the classpath.
Jason
Phill
Hello,<br />
<br />
i copied my rptdesign into the RE API folder.<br />
At next i had export my classes to a jar file, and copied it to the same folder like the rptdesign file.<br />
<br />
But the same errors are coming:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
Caused by: org.eclipse.birt.core.exception.CoreException: Error evaluating Javascript expression. Script engine error: TypeError: [JavaPackage staff.Staff] is not a function, it is object. (/report/data-sets/oda-data-set[
@id="
;215"]/method[
@name="
;beforeOpen"]#2)
Script source: /report/data-sets/oda-data-set[
@id="
;215"]/method[
@name="
;beforeOpen"], line: 0, text:
__bm_beforeOpen()
</pre>
<br />
What is my failure?<br />
<br />
thanks
Susana
Make sure your .jar is in your classpath.
Phill
Should the *.jar file in my "server classpath" or in the class path of the RP API ?
Becaue i call the RP API with my java server.
thanks
JasonW
If you are using 3.7 it should work anywhere in the classpath.
Jason
Phill
Hello,
i have add the jar file to my server class path and it run without any problems atm.
But i test it tomorrow at work exactly.
thanks for your help
JasonW
Glad to hear (I mean read :> )