On April 27, 2024, our Sign-in and Create Account options will be unavailable from 9am-12pm ET. During this maintenance window, developer account access and free trial registration will be unavailable.

BIRT: Dynamic Image Examples

Virgil
Virgil AdministratorEM admin
edited 2013 01 in DevShare Downloads #1
Two different approaches for getting dynamic images into a BIRT report design. One approach use a script on the image onRender event to change the name of the image at runtime:
if(row["CREDITLIMIT"] < 25000 )
    this.file = this.file.replace("happy", "sad");
<br />
...and the other approach uses a computed column on the dataset to dynamically change the location of the image:
if (row&#91;"CREDITLIMIT"] &lt;= 0) {
  "down.jpg"
} else {
  "up.jpg"
}
<br />
Both approaches pick up the image from a relative URL inside the same project. These examples were created with BIRT 2.2.