1276013 - Strange characters displays in a Text Editor when opening a report exported to CSV format from Crystal Reports

SAP Knowledge Base Article - Public

1276013 - Strange characters displays in a Text Editor when opening a report exported to CSV format from Crystal Reports

Symptom

  • 0xEFBBBF
  • Characters like: 0xEFBBBF are displayed in the exported file.
  • CSV file contains garbage characters like: ï,»,¿, at beginning of file.
  • When exporting a report to CSV format from Crystal Reports, it add hexadecimals, or strange characters at the beginning of the generated CSV file.

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.
  2. Add a couple of fields in the Details section.
  3. Export the report to CSV format.
  4. In the Seperated Values Export options select Standard mode.
  5. When opening the file generated in a text editor, it displays hexadecimals characters.

Cause

  • The hexadecimal characters seen in the exported report are the BOM (Byte Order Mark 0xEFBBBF) of the UTF-8 encoding.
  • This BOM is added to help programs to determine the encoding of the Comma separated value (CSV) file.

Resolution

  • To resolve the issue set the registry key: IncludeUTF8BOM to the value: 1
             
    WARNING The following resolution involves editing the Microsoft Registry. Using the MS Registry Editor incorrectly can cause serious problems. Use the MS Registry Editor at your own risk. For more information see the SAP Knowledge Base Article 1323322        
    1. Close Crystal Reports designer.
           
    2. Open the Microsoft Registry Editor. 
      1. Under the menu "Start" in MS Windows, select "Run"
      2. Type: regedit
         
    3. In the MS Registry Editor, navigate to the path corresponding to the version of Crystal Reports used:
            
      • For Crystal Reports 2008:
          
            HKEY_LOCAL_MACHINE\SOFTWARE\Business Objects\Suite 12.0\Crystal Reports\Export\CSV
            
      • For Crystal Reports 2011, 2013,2016:
          
            HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Suite XI 4.0\Crystal Reports\Export\CSV
          
        Important Notes:
        - If the last part of the path does not exist, simply add the missing keys.
        - If you are using a 64bit Edition of MS Windows, the registry path will start with: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node
          
    4. Under CSV, add the DWORD Value: IncludeUTF8BO, and set the value to: 1
      1. Right click on the CSV key, and select "New - DWORD Value"
      2. Set the DWORD Value to: IncludeUTF8BO
      3. Set the value of UTF16Mode to: 1

Now when exporting a report that contains umlaut characters to CSV format, and opening it in a Text Editor, it will no longer display hexadecimal charcaters at the start of the file.

Keywords

CSV,Hex,CR,standard , KBA , BI-RA-CR , Crystal Reports designer or BusinessViews Manager , Problem

Product

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