Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0007030Openbravo ERPB. User interfacepublic2009-01-20 16:132014-08-21 15:48
networkb 
iperdomo 
immediatemajoralways
closedout of date 
5
2.40 
 
OBPS
Core
No
0007030: Language translations are not working in Jasper-subreports
Language translations are not working in Jasper-subreports
To generate this bug please reproduce the following steps:
-Create a jasper report by means of iReport with this structure: one parent report and two sub-reports.
-Create three *.jrxml files. These files should contain static texts and text fields that need to be automatically translated by the ERP application. Once finished, compile the three *.jrxml in order to create the corresponding *.jasper files.
-Upload them (in total 6 files) into the environment (/ad_reports).
-Compile complete (my case is 2.40 Network).
-Go to the ERP and generate the corresponding report.
-See that some sub-report fields have not been translated automatically.
No tags attached.
depends on backport 0007086 closed iperdomo Language translations are not working in Jasper-subreports 
png Pantallazo.png (179,908) 2009-01-20 16:13
https://issues.openbravo.com/file_download.php?file_id=679&type=bug
png
Issue History
2009-01-20 16:13networkbNew Issue
2009-01-20 16:13networkbAssigned To => rafaroda
2009-01-20 16:13networkbsf_bug_id0 => 2523893
2009-01-20 16:13networkbFile Added: Pantallazo.png
2009-01-20 16:13networkbOBNetwork customer => Yes
2009-01-20 16:13networkbRegression testing => No
2009-01-20 18:31emartinezIssue Monitored: emartinez
2009-01-20 18:37emartinezNote Added: 0012410
2009-01-21 11:14rafarodaNote Added: 0012438
2009-01-21 11:14rafarodaStatusnew => feedback
2009-01-21 11:17networkbNote Added: 0012439
2009-01-21 11:17networkbStatusfeedback => new
2009-01-21 16:01rafarodaAssigned Torafaroda => gorkaion
2009-01-21 18:42rafarodaNote Added: 0012484
2009-01-21 18:42rafarodaAssigned Togorkaion => iperdomo
2009-01-21 18:42rafarodaStatusnew => feedback
2009-01-22 09:55emartinezNote Added: 0012502
2009-01-22 09:56emartinezNote Edited: 0012502
2009-01-22 09:58networkbStatusfeedback => new
2009-01-22 09:59rafarodaSummaryLanguage translations for special characters are not working => Language translations are not working in Jasper-subreports
2009-01-22 09:59rafarodaDescription Updated
2009-01-22 09:59rafarodaProposed Solution updated
2009-01-22 09:59rafarodaSteps to Reproduce Updated
2009-01-22 10:23iperdomoNote Added: 0012507
2009-01-22 10:23iperdomoStatusnew => feedback
2009-01-23 10:53iperdomoStatusfeedback => scheduled
2009-01-23 10:53iperdomofix_in_branch => trunk
2009-01-23 13:40iperdomoNote Added: 0012570
2009-01-23 13:40iperdomoStatusscheduled => feedback
2009-01-27 20:11iperdomoStatusfeedback => closed
2009-01-27 20:11iperdomoNote Added: 0012713
2009-01-27 20:11iperdomoResolutionopen => out of date
2014-08-21 15:48SephShomNote Added: 0069578

Notes
(0012410)
emartinez   
2009-01-20 18:37   
My case is the following: I am developing a Jasper Report, and the workaround you proposed only worked for the PARENT Report, not for the subreports.

Besides that, some many static fields of these subreports were not automatically detected when compiling the application and thus added to the table AD_TEXTINTERFACES, so for these cases, I could not even apply the workaround.
(0012438)
rafaroda   
2009-01-21 11:14   
Hi Elena,

Is this subreport that you created a pre-compiled sub-report? I mean, it is not compiled at execution time but the *.jasper is already prepared.

If this is the case, I'm afraid that the translation of the sub-report will not be possible.

Provide feedback as soon as possible.

Thanks.
(0012439)
networkb   
2009-01-21 11:17   
Yes, this kind of subreport causes the problem
(0012484)
rafaroda   
2009-01-21 18:42   
Please provide the steps to reproduce this issue. Thank you.
(0012502)
emartinez   
2009-01-22 09:55   
(edited on: 2009-01-22 09:56)
To generate this bug please reproduce the following steps:
-Create a jasper report by means of iReport with this structure: one parent report and two sub-reports.
-Create three *.jrxml files. These files should contain static texts and text fields that need to be automatically translated by the ERP application. Once finished, compile the three *.jrxml in order to create the corresponding *.jasper files.
-Upload them (in total 6 files) into the environment (/ad_reports).
-Compile complete (my case is 2.40 Network).
-Go to the ERP and generate the corresponding report.
-See that some sub-report fields have not been translated automatically.

Hope this helps.

(0012507)
iperdomo   
2009-01-22 10:23   
@emartinez:

The jrxml files are *always* parsed and translated. The problem is that your original definition of your parent report is pointing to the 'english' subreport.

If using iReport you defined in the subreport properties: $P{BASE_DESING}+'path/to/your/subreport/mySubreport.jasper' you are defining that the subreport to be displayed is the one in $P{BASE_DESIGN} 'src-loc/desing/path/to/your/subreport'... when using a different language than english, the location of the resource files $P{BASE_DESING} is changed to 'src-loc/es_ES/path/to/your/subreport' (in the spanish Spain case).

You need to open the jrxml template in WebContent/src-loc/es_ES and compile it with iReport, also modify the parent template to use this new location.

With the current release of Openbravo, you can't define the location of the subreports, that is why you define to point the .jasper directly.

Best Regards,

Iván
(0012570)
iperdomo   
2009-01-23 13:40   
A new task was added to compile all the reports in ad_reports folder. Check the attached file in the 2.40 backport.

Usage:

ant compile.jasper -Dlang=es_ES

Where es_ES is the language installed in the system on which we want to generate the .jasper from .jrxml

This will delete all the .jasper files in WebContent/src-loc/es_ES/org/openbravo/erpCommon/ad_reports and recompile them (create a .jasper)

Important: New .jasper files will be created for header reports, even if those are not used.
(0012713)
iperdomo   
2009-01-27 20:11   
This issue is not reproducible in trunk
(0069578)
SephShom   
2014-08-21 15:48   
Please. I Couldn't find another post so clear about this issue. I need to ask if to version 3 something has been changed about translation subreports, couse i have this: protected String getBaseDesignPath(String language) {
    if (log4j.isDebugEnabled()) {
      log4j.debug("*********************Base path: " + globalParameters.strBaseDesignPath);
    }
    String strNewAddBase = globalParameters.strDefaultDesignPath;
    String strFinal = globalParameters.strBaseDesignPath;
    // if (!language.equals("") && !language.equals("en_US")) {
    // strNewAddBase = language;
    // }
Those lines shouldn be commented if is necesary to find some es_ES directory. Language translations are not working with Jasper Subreports. Please some help.