Format pattern not respected

Bug #917044 reported by Eus
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KDE OpenObject Client
New
Undecided
Unassigned

Bug Description

[Problem]
1. Create and populate a testing table in an OpenERP database:

CREATE TABLE test_table (
        id integer NOT NULL,
        field_date date,
        field_decimal numeric,
        CONSTRAINT pk PRIMARY KEY (id)
);

INSERT INTO test_table VALUES (6, 'January 31, 2010', 12345.22);
INSERT INTO test_table VALUES (100, 'April 14, 2011', 2111222.23);
INSERT INTO test_table VALUES (200, 'November 13, 2011', 212.348);

2. Use iReport 4.5.0 (http://sourceforge.net/projects/ireport/) to test the jasper report file "test_field_formatting.jrxml" included in the attached file.

Click icon "Report Datasources" below the menu.
Click button "New" on the right-hand side.
Select "Database JDBC connection" and click "Next".
Type "OpenERP" on field "Name".
Select "PostgreSQL (org.postgresql.Driver)" for "JDBC Driver".
Edit "JDBC URL" to point to the OpenERP database containing table test_table.
Type the database username.
Click button "Test".
If connection is okay, click button "Save".

Click button "Close".

Open menu "Tools" -> "Options" -> "iReport" tab -> "Viewers" tab.
Fill in "/usr/bin/evince" (with the quotes) to field "PDF Viewer".
Click button "OK".

Open menu "Preview" and select "PDF Preview".

Click button "Preview" just on top of the ruler, and Evince window will be opened displaying the PDF file of the jasper report as file "report_generated_by_ireport.pdf" included in the attached file.

3. Register the jasper report attached in this e-mail into OpenERP:
Administration -> Customization -> Jasper Reports -> Jasper Reports -> New

Name: test_report
Model: res.partner
Service Name: test_report_pdf
Jasper Output: PDF

Jasper Reports File -> New

File: select the jasper report attached in this e-mail
Default: selected
Save & Close

Save

4. Test the report:
Sales -> Address Book -> Customers

Double click one of the records and click test_report button on the right-hand side.

5. The PDF is displayed but the date and number formatting patterns are not respected as can be seen in PDF file "report_generated_by_jasper_report_module.pdf" included in the attached file.

[Culprit]
The jasperreports library included in NaN-tic's jasper_reports module is outdated. The indication is that iReport can successfully render the format pattern.

Therefore, update the jasperreports library of the NaN-tic jasper_reports module by executing:
cd java/lib
./update-jasper-reports.sh [IREPORT_4.5.0_DIR]

[New Problem]
But, with the new jasperreports library in place, a Java class from NaN-tic fails to compile the .jrxml file with the following exception:
java.lang.NullPointerException
        at net.sf.jasperreports.engine.design.JRDesignExpression.setValueClass(JRDesignExpression.java:94)
        at com.nantic.jasperreports.I18nGroovyCompiler.generateSourceCode(I18nGroovyCompiler.java:157)
        at net.sf.jasperreports.engine.design.JRAbstractCompiler.createCompileUnit(JRAbstractCompiler.java:267)
        at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:164)
        at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:212)
        at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:128)
        at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:110)
        at com.nantic.jasperreports.JasperServer.compile(JasperServer.java:72)
        at com.nantic.jasperreports.JasperServer.privateExecute(JasperServer.java:111)
        at com.nantic.jasperreports.JasperServer.execute(JasperServer.java:95)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at org.apache.xmlrpc.server.ReflectiveXmlRpcHandler.invoke(ReflectiveXmlRpcHandler.java:115)
        at org.apache.xmlrpc.server.ReflectiveXmlRpcHandler.execute(ReflectiveXmlRpcHandler.java:106)
        at org.apache.xmlrpc.server.XmlRpcServerWorker.execute(XmlRpcServerWorker.java:46)
        at org.apache.xmlrpc.server.XmlRpcServer.execute(XmlRpcServer.java:86)
        at org.apache.xmlrpc.server.XmlRpcStreamServer.execute(XmlRpcStreamServer.java:200)
        at org.apache.xmlrpc.webserver.Connection.run(Connection.java:208)
        at org.apache.xmlrpc.util.ThreadPool$Poolable$1.run(ThreadPool.java:68)

That is, the custom .jrxml-to-.jasper compiler from NaN-tic, which is I18nGroovyCompiler, needs to be updated as well.

Since both iReport and NaN-tic jasper_reports module are licensed under GPL, it is okay to replace the NaN-tic jasper report compiler by iReport jasper report compiler. Why doesn't NaN-tic do this from the start?

Revision history for this message
Eus (eus-member) wrote :
Revision history for this message
Eus (eus-member) wrote :

This bug still exists at the latest revision 1793 of http://bazaar.launchpad.net/~openobject-client-kde/openobject-client-kde/5.0/

Revision history for this message
Albert Cervera i Areny - http://www.NaN-tic.com (albert-nan) wrote :

Hi Eus, the reason for not updating the libraries is some compatibility issues with previous versions of jasper reports. Those users who have used older versions and thus have their .jrxml created by those releases would be annoyed if we update to incompatible or problematic releases such as 4.5.

Regarding the compiler, NaN·tic's one is an improvement over the one in standard jasper reports, which includes several functions that ease internationalization of reports. Simply recompiling it with the new libraries should probably be enough.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.