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

SAP Knowledge Base Article - Public

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

Symptom

  • Blank spaces are removed to the right of fields.
  • Data trailing spaces trimmed.
  • Crystal Reports removes data trailing spaces. 

Environment

  • SAP Crystal Reports 2008
  • SAP Crystal Reports 2011
  • SAP Crystal Reports 2013
  • SAP Crystal Reports 2016

Reproducing the Issue

  1. In Crystal Reports, create a report off any data source that contains data with trailing spaces
  2. Notice the data 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 are removed.

Cause

  • Crystal Reports removes trailing spaces by default.

Resolution

 

CAUTION

The following resolution involves editing the registry. Using Registry Editor incorrectly can cause serious problems that may require you to reinstall the Windows operating system. Use Registry Editor at your own risk. For Information on How to Edit the Registry Key View the Changing Keys And Values online Help topic in Registry Editor (Regedit.exe).It is strongly advised that you make a backup copy of the registry files before you edit the registry.

  • In Crystal Reports, to keep the data trailing spaces, add the registry key: TrimTrailingSpace, and set the value to: No
       
    1. In MS Windows, go to the following path in the Microsoft Registry Editor.
      • For Crystal Reports 2008 :  HKLM\Software\Business Objects\Suite 12.0\Crystal Reports\DatabaseOptions
      • For Crystal Reports 2011 :  HKLM\Software\SAP BusinessObjects\Suite XI 4.0\Crystal Reports\DatabaseOptions
      • For Crystal Reports 2013 :  HKLM\Software\SAP BusinessObjects\Suite XI 4.0\Crystal Reports\DatabaseOptions
          
    2. Add a String Value: TrimTrailingSpace
         
    3. Set the value to    : No

Keywords

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

Product

Crystal Reports 2008 V0 ; Crystal Reports 2008 V1 ; SAP Crystal Reports 2011 ; SAP Crystal Reports 2013

Attachments

TrimTrailingSpace.bmp