SAP Knowledge Base Article - Public

1284188 - Trailing blank spaces are removed from data in Crystal Reports

Symptom

  • Data trailing spaces trimmed.
  • Blank spaces are removed to the right of fields.
  • Crystal Reports removes data trailing spaces. 
  • How to preserve the data trailing spaces when reporting of any data sources in Crystal Reports?

Environment

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

Reproducing the Issue

  1. In Crystal Reports, create a report based on any data source that contains data with trailing spaces.
           
  2. When refreshing the report, notice the trailing spaces are trimmed in Crystal Reports.

For example if we have the following value in the database padded with spaces to always store it with 10 characters

    • Car         
    • Bicycle    
    • Airplane  

The value: Car, has 3 characters and 7 white spaces. ( Highlighted in yellow are all the characters stored in the database )

In Crystal Reports, the data will look like:

    • Car
    • Bicycle
    • Airplane

As you notice, the trailing spaces has been removed.

Cause

  • When connecting to any data source, Crystal Reports removes trailing spaces by default.

Resolution

  • In Crystal Reports, to keep the data trailing spaces, 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

Trailing space removed, CR , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , Problem

Product

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

Attachments

TrimTrailingSpace.bmp