cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal not accepting new line character

Former Member
0 Kudos

Hi All,

We are using Crystal 2013 connected to ECC database. In ECC - FM side, multiple line items with special and new line characters are maintained as text description. However, Crystal report is not able to recognize the new line character. Previously, crystal report was displaying “<(>” instead of new line character, so we placed a logic: replace({text_desc},"<(>",chr(10)) and it was working fine.


However, we found 1-2 cases where crystal was still not able to recognize new line character and is displaying in a single line irrespective of new line character given in ECC.

Logic1

stringVar array x := split({text_desc},chr(10));

Local numberVar i;

Local stringVar outputString := "";

outputString := x[1] + Chr(10);



Logic2

stringVar array x := split({text_desc},chr(10));

Local numberVar i;

Local stringVar outputString := "";

For i:=1 to Count(x) do

(

outputString := outputString + x[i] + Chr(10)

);

The above two are not working as expected.

Accepted Solutions (0)

Answers (1)

Answers (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Sameer,

Does the field have new line feeds in the form of '<(>' or chr(10)?

What does the following formula return:

IF Instr({text_desc}, chr(10)) > 0 then 'CHR1'

else if Instr({text_desc}, chr(13)) > 0 then 'CHR2'

-Abhilash

Former Member
0 Kudos

Abhilash,

It is not going to any of the conditions mentioned by you. Is it some configuration issue?

IF Instr({text_desc}, chr(10)) > 0 then 'CHR1'

else if Instr({text_desc}, chr(13)) > 0 then 'CHR2'

else "Default"

It is going to "Default".

abhilash_kumar
Active Contributor
0 Kudos

Which means the string doesn't have a new line character in the form of chr(13) or chr(10).

-Abhilash

Former Member
0 Kudos

In that case, ECC support team is trying in front of me and they are simply pressing "Enter" on keyboard and giving first, second and third line details.

abhilash_kumar
Active Contributor
0 Kudos

Perhaps 'enter' from ECC is not passed down as 'chr(13)' to CR.

Ask them to use something else as a new line feed - e.g. ~#

-Abhilash

Former Member
0 Kudos

Hi Abhilash,

Business team is not accepting this as a solution. These special characters can be used in user comments / remarks anytime.

I am left with no other option but to raise high priority OSS.

Best Regards,

Sameer

abhilash_kumar
Active Contributor
0 Kudos

I would recommend doing that too.

Once you do receive a solution, please do post back here.

-Abhilash