Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » get report title and force a specific Locale
get report title and force a specific Locale [message #769222] Wed, 21 December 2011 15:47 Go to next message
Alessio Pollero is currently offline Alessio PolleroFriend
Messages: 74
Registered: August 2011
Member
I'm trying to get the report title text from the design API. I written a function like the one below to retrieve the text :

public String getReportTitle(String rpt) {

		SessionHandle session = DesignEngine.newSession(ULocale.ITALIAN);
		
			ReportDesignHandle reportTitleDesign = session.openDesign(rpt);
			LabelHandle labelTitle = (LabelHandle) reportTitleDesign.findElement("reportTitle");

			
		return labelTitle.getText();
	}

The function work correctly but retrieve the default title that is in English locale, while i want to retrieve the Italian one ... I've tried setting the locale as shown in the function above but it didn't worked ...

The reportTitle label is placed in the header of masterpage ...

How can i get a text of a label in a given locale ? Is what i'm doing the right way to do it ?

Re: get report title and force a specific Locale [message #769751 is a reply to message #769222] Thu, 22 December 2011 16:22 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Have you tried labelTitle.getDisplayText();
This should try to retrieve the localized value.

Jason


On 12/21/2011 10:47 AM, Alessio Pollero wrote:
> I'm trying to get the report title text from the design API. I written a
> function like the one below to retrieve the text :
> public String getReportTitle(String rpt) {
>
> SessionHandle session = DesignEngine.newSession(ULocale.ITALIAN);
>
> ReportDesignHandle reportTitleDesign = session.openDesign(rpt);
> LabelHandle labelTitle = (LabelHandle)
> reportTitleDesign.findElement("reportTitle");
>
>
> return labelTitle.getText();
> }
>
> The function work correctly but retrieve the default title that is in
> English locale, while i want to retrieve the Italian one ... I've tried
> setting the locale as shown in the function above but it didn't worked ...
>
> The reportTitle label is placed in the header of masterpage ...
>
> How can i get a text of a label in a given locale ? Is what i'm doing
> the right way to do it ?
>
>
Re: get report title and force a specific Locale [message #769780 is a reply to message #769751] Thu, 22 December 2011 16:55 Go to previous message
Alessio Pollero is currently offline Alessio PolleroFriend
Messages: 74
Registered: August 2011
Member
Ok, it worked thank you !
Previous Topic:BIRT Parameter overhead
Next Topic:Get an IReportDocument from IRunAndRenderTask
Goto Forum:
  


Current Time: Thu Apr 18 05:00:36 GMT 2024

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

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

Back to the top