Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Removing carriage returns from a column output
Removing carriage returns from a column output [message #1059117] Thu, 16 May 2013 16:07 Go to next message
josh hinson is currently offline josh hinson
Messages: 2
Registered: May 2013
Junior Member
So I have been searching for a few hours on this and the problem mainly stems from the fact that I'm a new user Rolling Eyes .

I have my query written, I have the output working with the exception of some of the results that are returned. Basically I have a large string of text (It's XML code in one column) that I have cut off with no word wrap on the results. The issue occurs whenever there is a carriage return in the XML itself, it will cause the display to show several lines and it looks like the "no word wrap" doesn't work.

The solution I had in my head initially was to write in the sql query itself to find carriage returns and replace them with spaces. This works in my normal SQL program but for some reason Birt doesn't execute this properly. replace(replace(MESSAGE_BODY, char(13), ''), char(10), '') AS FOD

The next thing I thought I could maybe use to solve this is by using the expression builder but my lack of javascript knowledge has prevented me from going any further with this solution.

Any help on this would be very much appreciated.
Re: Removing carriage returns from a column output [message #1059408 is a reply to message #1059117] Sat, 18 May 2013 00:28 Go to previous messageGo to next message
Michael Williams is currently offline Michael Williams
Messages: 828
Registered: July 2009
Senior Member

One thing you could do would be to write an expression like this in a computed column:

myText = row["yourXML"];
while(myText.indexOf(breakcharacter) != -1){
myText = myText.replace(breakcharacter,"");
}
myText;


Then, you'd use this new column in your table.


Regards,

Michael Williams
BIRT Exchange
Michael's BIRT Blog
Re: Removing carriage returns from a column output [message #1059595 is a reply to message #1059408] Mon, 20 May 2013 12:45 Go to previous messageGo to next message
josh hinson is currently offline josh hinson
Messages: 2
Registered: May 2013
Junior Member
Thank you so much for your response. While I think this is exactly the type of solution that I am looking for, I get the following error message when I run the query after adding this expression to the column:

org.eclipse.birt.report.engine.api.EngineException: Binding "FOD" has dependency cycle.

Re: Removing carriage returns from a column output [message #1059642 is a reply to message #1059595] Tue, 21 May 2013 01:18 Go to previous message
Michael Williams is currently offline Michael Williams
Messages: 828
Registered: July 2009
Senior Member

Any way you can recreate this issue in a way that I can run the report, so I can test on it? Thanks!

Regards,

Michael Williams
BIRT Exchange
Michael's BIRT Blog
Previous Topic:Date parameter not Working
Next Topic:how to get listbox in <birt:viewer>
Goto Forum:
  


Current Time: Tue May 28 22:31:07 EDT 2013

Powered by FUDForum. Page generated in 0.01603 seconds