cancel
Showing results for 
Search instead for 
Did you mean: 

'\r\n' problem with RTF export

Former Member
0 Kudos

Hello ppl,

When i do a RTF export of a data containing carraige return and new line(\r\n),i get two new lines instead of one in the exported RTF but in the DHTML viewer it shows only one line.

SInce it dispalys two lines instead of one the original data gets hid within the textbox which contains the data.

The same report works fine with CR designer in case of RTF export...

Is this a limitation of JRC?

Thanks ,

Prem

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

thank you

Former Member
0 Kudos

After doing some research I have found that using the \n and \r are not the standard for adding new line and carriage returns to your text. The reason is that some protocols do not recognize such characters and may convert them into something else you do not recognize.

Try using the ASCII or Unicode interpretation of the new line and carriage return. In Crystal Reports, you can use ChrW(x), where x is the unicode interpretation of the character, to add those characters to your text.

Former Member
0 Kudos

thank you.

Try using the ASCII or Unicode interpretation of the new line and carriage return

did you mean that i have to use this in the javacode while storing the values to database.Moreover i am not manually inserting \n or \r when user presses the enter key while entering data in a text area and saves it then the new line is converted to \n \r in java automatically and it is stored as two square brackets boxed in database.

i also found removing \n from the \n\r combination created only one line during export.

you can use ChrW(x),

where should i use this crystal reports. i am using the datbase filed directly in my reports.

Prem

Former Member
0 Kudos

If the users are entering the text and then you are storing it in the database, you may need to account for how this character is stored. As I mentioned, during some research about the newline character, I discovered that some applications are much stricter about formatting and may expect the ascii or unicode interpretations of such characters, and as such don't know how to correctly process the /r and /n. This behavior isn't specific to the JRC.

The ChrW(x) function is a function of Crystal Reports that can be used in a formula. If you are storing your data in the database with the new line and carriage returns already embedded, then it isn't applicable to you.