Skip to main content



      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 10:47 Go to next message
Eclipse UserFriend
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 11:22 Go to previous messageGo to next message
Eclipse UserFriend
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 11:55 Go to previous message
Eclipse UserFriend
Ok, it worked thank you !
Previous Topic:BIRT Parameter overhead
Next Topic:Get an IReportDocument from IRunAndRenderTask
Goto Forum:
  


Current Time: Wed Jul 23 10:13:23 EDT 2025

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

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

Back to the top