Focal Point
Carriage Returns

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/8751068331

June 02, 2005, 06:05 PM
slfmr
Carriage Returns
I am pulling an field (with all it's answers) from a database using pass-thru sql. What happens is it pulls correctly, but when I display it in my PDF report, the answer is cut off where there is a carriage return in it.

This field is a comment box. So if a user inserts a comment then a carriage return and another comment, the second comment won't appear.

Has anyone encountered this or have any idea on why this is occuring?
June 02, 2005, 06:12 PM
reFOCUSing
Have you tried using the CTRAN function to remove the carriage return. I believe the decimal value of a carriage return is 13.

ASCII Look-up table
June 02, 2005, 07:16 PM
slfmr
I have never used the CTRAN function before, but I am currently doing some research on it and will try it out.

Is there an example of how to use it. I generally go to the WebFocus Help Contents, but if you have an easier way to show or explain, I would appreciate your thoughts.

Thanks so much for the reply!!
June 02, 2005, 07:50 PM
reFOCUSing
field2/A20 = CTRAN(20,field1,13,32,field2);

field1 - input fieldname
field2 - output fieldname
20 - lenght of field1
13 - Carriage Return
32 - Space
June 02, 2005, 08:49 PM
<Ken>
I run into this all the time. I handle it in SQL by replacing CR and LF with spaces

REPLACE(REPLACE(tn.vchNote,CHAR(10),' '),CHAR(13),' ') AS [Notes]
June 02, 2005, 09:59 PM
slfmr
Okay so Ken, I would just throw that in the actual SQL statement?

Select *
From *
Where *
Replace....
June 02, 2005, 10:06 PM
slfmr
Okay, nevermind, i would use the REPLACE as an item in the SELECT area.

Thanks so much, I am working with it!!
June 02, 2005, 10:22 PM
slfmr
What kind of format would that be given?

After the SQL, i have:

DEFINE FILE MYFILE
ANSWER/????? = IF VALUE EQ 808 THEN Notes;
END

How would the format work? I keep getting an error about comparing computational and alpha values.

Thank you
June 02, 2005, 10:38 PM
slfmr
Okay, it seemed to not even need to be a part of the DEFINE and it worked perfectly.

Thanks so much everyone for your input!!