Skip to main content



      Home
Home » Archived » BIRT » Script Datasources and Java packages
Script Datasources and Java packages [message #45193] Mon, 13 June 2005 03:44 Go to next message
Eclipse UserFriend
Hi all

I have a script data source where i try to access a Java Class

on dataset's open method:

<snip>
....
cf = new Packages.gr.osmosis.report.data.ContactListFactory();
....
</snip>

unfortunately i get the error message:

<snip>
There are errors on the report page:
Error1:Invalid Javascript expression. Source: DataSet:setScript.open, line:
0, Expression:
function_prefix_1118645822385();function
function_prefix_1118645822385(){count = 0;
cf = new Packages.gr.osmosis.report.data.ContactListFactory();
c = fc.createContactList();}
Script engine error: TypeError: [JavaPackage
gr.osmosis.report.data.ContactListFactory] is not a function.
(DataSet:setScript.open#1)
</snip>

my report lives in the same project with those java classes.

Any hint?


regards

stavros


--
Stavros Kounis Osmosis networks & consulting
http://tools.osmosis.gr/blog http://www.osmosis.gr
Re: Script Datasources and Java packages [message #53455 is a reply to message #45193] Tue, 05 July 2005 06:36 Go to previous messageGo to next message
Eclipse UserFriend
The WebbApp preview plugin couldn
Re: Script Datasources and Java packages [message #53924 is a reply to message #45193] Wed, 06 July 2005 03:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Dirk.Ecker.viadee.de

A solution is explained in:
http://tools.osmosis.gr/blog/archives/2005/06/birt_and_objec t.html

Excerpt:

Preview
Here is a litle problem when we are working in design mode. Report's
script must be able to find our java classes (Contact.java,
ContactListFactory.java). Report designer use BIRT's web-app viewer to
render (preview) the report. But this WEB-APP does not know where to look
for our java classes. This web-app exist as an eclipse plug-in.

for example:



C:\JProgramFiles\eclipse-SDK-3.0.2-win32\eclipse\plugins\org .eclipse.birt.report.viewer_1.0.0

We have to put our classes in a "classes" folder in this web-app. To do
this create a "classes" folder at birt\web-inf.

Build Contact.java and ContactListFactory.java and put the produced .class
files in this "classes" folder.
Dont forget to create inside "classes" folder the directory structure that
match the package name.

for example:



if you just copy paste the code from this post then you must have a path
like:

C:\JProgramFiles\eclipse-SDK-3.0.2-win32\eclipse\plugins\org .eclipse.birt.report.viewer_1.0.0\birt\WEB-INF\classes\gr\os mosis\report\data

Now you can preview your report selecting "Preview" tab.

Dirk
Re: Script Datasources and Java packages [message #58363 is a reply to message #53924] Thu, 14 July 2005 11:25 Go to previous message
Eclipse UserFriend
Originally posted by: tstuchel.yahoo.com

I attempted this solution and was unsuccessful. I placed the full contents
of the /classes directory of my Java project into the directory (for me):

C:\java\eclipse\plugins\org.eclipse.birt.report.viewer_1.0.0 \birt\WEB-INF

such that I had:

C:\java\eclipse\plugins\org.eclipse.birt.report.viewer_1.0.0 \birt\WEB-INF\classes\[project
class structure]

and I still get the "is not a function" to the default constructor of my
class. The class has only one method, the constructor, which takes no
parameters.

Is there something else that I am missing? I get a pop-up error with the "is
not a function" error whenever I use the Data Explorer, even when I edit the
code for the Data Source or the Data Set that uses it (that is, without
actually running a preview).


"Dirk Ecker" <Dirk.Ecker@viadee.de> wrote in message
news:abb725c7507254da5338bebb465c4cba$1@www.eclipse.org...
>A solution is explained in:
> http://tools.osmosis.gr/blog/archives/2005/06/birt_and_objec t.html
>
> Excerpt:
>
> Preview
> Here is a litle problem when we are working in design mode. Report's
> script must be able to find our java classes (Contact.java,
> ContactListFactory.java). Report designer use BIRT's web-app viewer to
> render (preview) the report. But this WEB-APP does not know where to look
> for our java classes. This web-app exist as an eclipse plug-in.
>
> for example:
>
>
>
> C:\JProgramFiles\eclipse-SDK-3.0.2-win32\eclipse\plugins\org .eclipse.birt.report.viewer_1.0.0
>
> We have to put our classes in a "classes" folder in this web-app. To do
> this create a "classes" folder at birt\web-inf.
>
> Build Contact.java and ContactListFactory.java and put the produced .class
> files in this "classes" folder.
> Dont forget to create inside "classes" folder the directory structure that
> match the package name.
>
> for example:
>
>
>
> if you just copy paste the code from this post then you must have a path
> like:
>
> C:\JProgramFiles\eclipse-SDK-3.0.2-win32\eclipse\plugins\org .eclipse.birt.report.viewer_1.0.0\birt\WEB-INF\classes\gr\os mosis\report\data
>
> Now you can preview your report selecting "Preview" tab.
>
> Dirk
>
Previous Topic:BIRT Installation Problem Unable To instantiate editor
Next Topic:Migrating our reports to BIRT
Goto Forum:
  


Current Time: Tue Jul 22 02:51:45 EDT 2025

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

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

Back to the top