Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Localization issue with parameters group prompts(This issue happens in a custom portlet and birt WebViewer)
Localization issue with parameters group prompts [message #759026] Fri, 25 November 2011 16:12 Go to next message
donino donino is currently offline donino donino
Messages: 162
Registered: July 2011
Senior Member
Hi,

in a portlet tomcat context, API 3.7.1, i use this below code to retrieve parameters definition.As shown in the code, i use task.setLocale(request.getLocale()) to manage localization. I have an issue with parameters groups prompt, it seems it doesnt use the correct language value (it uses my tomcat's locale, instead of request.getLocale()), whereas scalar parameters prompt are correct.
Anyone used these group prompt successfully with api?
Should i log a bugzilla entry or am i doing something wrong?

EDIT: i tried my report with WebBirtViewer, and this kind of url:

http://localhost:8080/birt/frameset?__report=report/welcome.rptdesign&__locale=en

I got exactly the same issue than in my portlet: In parameters Dialog, Viewer displays scalar with "en" locale values, but parameters groups with "fr" values Sad



Thanks!

        IGetParameterDefinitionTask task = birtReportEngine.createGetParameterDefinitionTask(this.getRptDesign()); 
        task.setLocale(request.getLocale());
        Collection params = task.getParameterDefns( true );
        
        Iterator iter = params.iterator( );
        while ( iter.hasNext( ) ) {         
            IParameterDefnBase param = (IParameterDefnBase) iter.next( );
            if ( param instanceof IParameterGroupDefn ){
                IParameterGroupDefn group = (IParameterGroupDefn) param;
 		Iterator iterGroup = group.getContents( ).iterator( );      
               // -------> group.getPromptText() and param.getPromptText() returns 'fr_FR' value, wich is my desktop local

		}                
            }else{
               // -------> param.getPromptText()  returns the request.getLocale() value, which is the expected behavior
            }
             
         }//end while
        task.close();

[Updated on: Fri, 25 November 2011 19:13]

Report message to a moderator

Re: Localization issue with group prompts [message #759504 is a reply to message #759026] Mon, 28 November 2011 20:16 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

This does appear to be a bug. Can you open a bugzilla request?

Jason

On 11/25/2011 11:12 AM, dpardon wrote:
> Hi,
> in a portlet tomcat context, API 3.7.1, i use this below code to
> retrieve parameter definition.As shown in the code, i use
> task.setLocale(request.getLocale()) to manage localization. I have an
> issue with parameters group prompt, it seems it doesnt use the correct
> language value, whereas scalar parameters prompt are correct. Anyone
> used these group prompt successfully with api? Should i log a bugzilla
> entry or am i doing something wrong?
>
> Thanks!
>
>
> IGetParameterDefinitionTask task =
> birtReportEngine.createGetParameterDefinitionTask(this.getRptDesign());
> task.setLocale(request.getLocale());
> Collection params = task.getParameterDefns( true );
> Iterator iter = params.iterator( );
> while ( iter.hasNext( ) ) { IParameterDefnBase param =
> (IParameterDefnBase) iter.next( );
> if ( param instanceof IParameterGroupDefn ){
> IParameterGroupDefn group = (IParameterGroupDefn) param;
> Iterator iterGroup = group.getContents( ).iterator( ); // ------->
> group.getPromptText() and param.getPromptText returns 'fr_FR' value,
> wich is my desktop local
>
> } }else{
> // -------> param.getPromptText() returns the request.getLocale(), which
> is the expected behavior
> }
> }//end while
> task.close();
>
Re: Localization issue with group prompts [message #759768 is a reply to message #759504] Tue, 29 November 2011 21:42 Go to previous message
donino donino is currently offline donino donino
Messages: 162
Registered: July 2011
Senior Member
Hi Jason,

I have logged this issue as Bug 365139
Previous Topic:Mismatch dataset count
Next Topic:Link in the report
Goto Forum:
  


Current Time: Fri Oct 24 16:27:56 GMT 2014

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

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