Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » [HOW] : Dynamically changing Label value(Label value should be changed dynamically through java code)
icon4.gif  [HOW] : Dynamically changing Label value [message #1007957] Fri, 08 February 2013 13:43 Go to next message
praneeth botta is currently offline praneeth bottaFriend
Messages: 6
Registered: January 2012
Junior Member
I need to dynamically change the Label value.

For example Label with name: X, has value= "Total Invoice"

How can i dynamically modify this to another value from java code ???

[Updated on: Fri, 08 February 2013 13:45]

Report message to a moderator

Re: [HOW] : Dynamically changing Label value [message #1008033 is a reply to message #1007957] Fri, 08 February 2013 15:40 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

From java or javascript within the report? Also, is this any label? Or just specific labels?

Michael

Developer Evangelist, Silanis
Re: [HOW] : Dynamically changing Label value [message #1008048 is a reply to message #1008033] Fri, 08 February 2013 16:11 Go to previous messageGo to next message
praneeth botta is currently offline praneeth bottaFriend
Messages: 6
Registered: January 2012
Junior Member
Michael Williams wrote on Fri, 08 February 2013 10:40
From java or javascript within the report? Also, is this any label? Or just specific labels?


1)From Java
2)Any label - I will give each label unique name that i know
Re: [HOW] : Dynamically changing Label value [message #1008074 is a reply to message #1008048] Fri, 08 February 2013 18:24 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

From your report design handle, you should be able to do something like:

designHandle.findElement("myLabel").setText("myValue");


Michael

Developer Evangelist, Silanis
Re: [HOW] : Dynamically changing Label value [message #1705602 is a reply to message #1008074] Mon, 17 August 2015 17:32 Go to previous messageGo to next message
Mario Flores is currently offline Mario FloresFriend
Messages: 2
Registered: August 2015
Junior Member
Hello, I understand this is an old topic but I wanted to know if this way of editing the labels has changed. I am currently trying to do the same thing as OP but I am unable to do so in Birt runtime 4.5.0 (the latest build).

I would really appreciate a lead or solution. Embarrassed

Thanks!
icon14.gif  Re: [HOW] : Dynamically changing Label value [message #1705624 is a reply to message #1705602] Mon, 17 August 2015 22:09 Go to previous message
Mario Flores is currently offline Mario FloresFriend
Messages: 2
Registered: August 2015
Junior Member
I figured out my own problem Rolling Eyes

From the book Integrating and Extending BIRT page 296:

//Access the label by name.
LabelHandle headerLabel = (LabelHandle) design.findElement("Header Label");
try {
headerLabel.setText("Updated " + headerLabel.getText());
} catch (Exception e) {
// Handle the exception
}

design being a ReportDesignHandle object.
Previous Topic:Indigo API Online Documentation no longer available
Next Topic:Birt reports cause temporary files to be generated in /Tmp folder
Goto Forum:
  


Current Time: Fri Apr 26 01:01:11 GMT 2024

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

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

Back to the top