KonaKart Community Forum

Installation / Configuration => Reporting => Topic started by: paulh on June 06, 2007, 05:08:07 pm

Title: modifying reports with eclipse
Post by: paulh on June 06, 2007, 05:08:07 pm
Im having a problem designing one of the existing reports within eclipse. When I preview it I get the error:

Script engine error: ReferenceError: "GetDbParams" is not defined

Im wondering if I need to add some jar files to the report design project but then again report design projects dont seem to have that option in project properties.

I made an absolute reference to konakart.rptlibrary in the Product List report

Anyway u guys know so I mays well ask here

Thanks Paul
Title: Re: modifying reports with eclipse
Post by: john on June 06, 2007, 06:11:32 pm
Hello Paul,

First of all, we are working on a solution to a problem in this area where the binding calls to odaPassword, odaUser, odaURL and odaDriverClass are made in different orders and people end up seeing a dbparams undefined error.   The quick, crude, fix to this for now is to add:

var dbparams = new GetDbParams("C:/Program Files/KonaKart/webapps/konakartadmin/WEB-INF/classes/konakartadmin.properties");

... in front of each of the 4 dbparams references.   This isn't very efficient and means you have to declare the filename in 4 places, so we will look for a neater solution for the next release.


To your main question:

The jar you want in your classpath is called konakartadmin_reports.jar  - you'll find it in /webapps/birt-viewer/WEB-INF/lib

Regards,
John
Title: Re: modifying reports with eclipse
Post by: paulh on June 06, 2007, 07:34:55 pm
So in a Report Designer project in eclipse do I need to create an ant build file to preview reports?

theres no option to specify jar files like there is on a normal java project.

can u paste ur ant file for reports here if that is the case.
Title: Re: modifying reports with eclipse
Post by: john on June 06, 2007, 07:51:21 pm
Hi Paul,

No, there's no ant build file.

You have to place them in your BIRT eclipse plugin.   Mine is at:

C:/eclipse/plugins/org.eclipse.birt.report.viewer_2.1.2.v20070205-1728/birt/

You should include:

commons-collections-3.1.jar
commons-configuration-1.1.jar
commons-lang-2.1.jar
konakart_reports.jar

You may find it easier to simlpy hard-code your db parameters while you're in development mode.   

Once you've finished, you may wish to put the library back becasue the advantage of using the konakart library is that you end up with just one place to define the database connection parameters for all your reports (somewhere you've already defined them - by pointing at the konakartadmin.properties file) and you inherit useful functionality like displaying prices using the default currency format of the store.

Regards,
John


Title: Re: modifying reports with eclipse
Post by: john on July 12, 2007, 10:48:55 am
Hi Paul,

This is just to let you know that this problem has been solved in the 2.2.0.4 release of KonaKart with a re-design of the report library code to ensure this works every time - and also from Eclipse (without needing to hard-code database parameters whilst in development).

You still need to add your properties filename reference (points to the file where your database connection parameters are defined) in konakart.rptlibrary - but there's only one reference to it so it's easier to maintain.  After a normal installation of KonaKart this will be set up correctly automatically.

If you have any problems with the 2.2.0.4 version, please don't hesitate to get back in touch.

John