SAP Knowledge Base Article - Public

1220462 - Carriage returns or line feeds are removed from report data in Crystal Reports

Symptom

  • Line feed not preserve.
  • Carriage return stored in a string field not performed in Crystal Reports.
  • When previewing a report in Crystal Reports, the carriage return characters are removed from the report data.

Environment

  • SAP Crystal Reports 2013
  • SAP Crystal Reports 2016
  • SAP Crystal Reports 2020 

Reproducing the Issue

  1. In a database, store text with carriage return at the end of each line, like:
      
        Line 1  ( Carriage Return )
        Line 2  ( Carriage Return )
          
  2. In Crystal Reports, create a report off the database
      
  3. Insert the database field in the Details section that contains text with carriage return.
      
  4. Format the database field, and check the option "Can Grow"
           
  5. When refreshing the report, notice the last carriage return is not performed.
     

Cause

  • By default in Crystal Reports, carriage return and line feed characters are removed from the data once it is retrieved from the database.

Resolution

  • To retain the carriage return and line feed characters in Crystal Reports, add the registry key: TrimTrailingSpace, and set the value to: No
       
    WARNING: The following resolution involves editing the Microsoft Registry. Using the Microsoft Registry Editor incorrectly can cause serious problems. Use the Microsoft Registry Editor at your own risk. For further information see the SAP Knowledge Base Article 1323322   
       
    1. Open the Microsoft Registry Editor ( regedit )   
             
    2. In the Microsoft Registry Editor, navigate to the following path: 
        
      • For Crystal Reports 2013, 2016:    
         
        • For 64 bit version of MS Windows:   
          HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\SAP BusinessObjects\Suite XI 4.0\Crystal Reports\DatabaseOptions
             
        • For 32 bit version of MS Windows:       
          HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Suite XI 4.0\Crystal Reports\DatabaseOptions   

                
      • For Crystal Reports 2020:
           
        • For 64 bit version of MS Windows:   
          HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Suite XI 4.0\Crystal Reports\DatabaseOptions 
               
    3. Add the STRING key: TrimTrailingSpace   
        
    4. Set the value to: No
          
    5. Restart Crystal Reports.            

Keywords

CHF 570589 LINE FEED CR LF CR/LF , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , Bug Filed

Product

SAP Crystal Reports 2013 ; SAP Crystal Reports 2016 ; SAP Crystal Reports 2020