BIRT Exchange Forum: Set the value of the Data within a Row - BIRT Exchange Forum

Jump to content


 

BIRT Poll: To best make a table fill a pdf page before breaking (PL=page layout, PBI=page break interval) set:

PL: auto, PBI: 0PL: fixed, PBI: 0PL: auto, PBI: 1000000PL: fixed, PBI: 1000000
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Set the value of the Data within a Row Rate Topic: -----

#1 User is offline   oamit1978 Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 07-April 12


Posted 07 April 2012 - 10:27 PM

I am pretty new to BIRT and have started just a day or two back. I have created a dataset and displaying the same inside a table. My problem in that in one my column I am expecting the values as 30.0;0.0;null where in I want replace each ";" with a "\n" so that while display each delimetre separated value is shown in a new row. I am trying to write an Event Handler for this however I couldn't locate on which event (whether onCreate, onPrepare and onRender) I should write this. Also how should I set the value of the data element to my desired value.
0

#2 User is offline   averma Icon

  • Senior Member
  • Icon
  • View blog
  • Group: Administrators
  • Posts: 713
  • Joined: 08-August 07


Posted 09 April 2012 - 09:06 AM

Hi oamit1978,
You can do this with a simple Javascript expression in your data element for that column. Here is an example that replaces all semicolons with a newline:
str = "a;b;c";
str.replace(/;/g, "\n");


Ashwini

Follow me on Twitter
Read my Blog BIRT Rocks!
0

#3 User is offline   oamit1978 Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 07-April 12


Posted 10 April 2012 - 11:50 PM

Thanks for your prompt response. Your code did helped me in solving some other issues however the mentioned problem I manage to solve by adding the REPLACE() function to my dataset SQL itself.
0

#4 User is offline   averma Icon

  • Senior Member
  • Icon
  • View blog
  • Group: Administrators
  • Posts: 713
  • Joined: 08-August 07


Posted 11 April 2012 - 09:06 AM

Handling at the database layer is even more efficient approach.
Ashwini

Follow me on Twitter
Read my Blog BIRT Rocks!
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users