SAP Knowledge Base Article - Public

1688471 - Trailing spaces are truncated when Crystal Report is exported to text format.

Symptom

  • Trailing spaces are truncated when Crystal Report created using data from a notepad++ having space at the end is exported to text format.
  • The truncated trailing spaces are displayed when the exported text format is opened with a notepad++.

Environment

Crystal Reports 2008

Reproducing the Issue

  1. In notepad++ enter a sentence like 'This line contains blank space at the end  ' (leave space after the line).
  2. Enable 'Show all Characters' option from the toolbar in notepad++.
  3. In notepad++, go to File > Save and save the .txt file.
  4. Launch Crystal Reports designer.
  5. Create a blank report.
  6. In Database Expert > Create New Connection > Access/Excel(DAO).
  7. Under connection, in Database Type select Text.
  8. In Database Name browse the .txt file.
  9. Drag the text file in Selected Tables section and click OK.
  10. In Field explorer, drag the fields from the Database Fields to the Details section of the report.
  11. Refresh the Crystal Report.
  12. Go to File > Export > Export Report > in Format select Text > Click OK.
  13. Save the exported text file and open it with Notepad++.

Cause

Crystal Report removes trailing spaces by default.

Resolution

  1. Go to the Registry Editor (Start > Run > Type regedit) and navigate to the below folder:
    HKey_current_user/Software/Business Objects/Suite 12.0/Crystal Reports/DatabaseOptions
  2. Right Click on Database options > New String Value > name it as TrimTrailingSpace
  3. Select Modify > Set the value data to: No

Keywords

Crystal Reports, trailing spaces truncated. , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , Problem

Product

Crystal Reports 2008 V0