SAP Knowledge Base Article - Public

1670482 - Export to RTF from Crystal Reports changes ASCII value of the hyphen character

Symptom

  • Hyphen character, "-", exported to RTF file format
  • ASCII code converter shows the ASCII value as 30 (space)
  • The exported hyphen character ASCII value should be 45

Environment

  • Crystal Reports 2008
  • Visual Studio .NET 2008

 

  • Crystal Reports for Visual Studio 2010
  • Visual Studio 2010

Reproducing the Issue

  1. Create a blank report in Crystal Reports
  2. Place a text field on the report header
  3. Edit the text field and place a hyphen in the text field..."-"
  4. Go to http://www.csgnetwork.com/asciicharacterconv.html and copy and paste the hyphen into the converter to see that it has a value of 45 in Hex format
  5. Export the report to RTF format
  6. Copy and paste the value into the ASCII code converter
  7. The hyphen value is 30, a blank space

Cause

  • This situation occurs due to the way it is exported to RTF. Reference: ADAPT01285054
  • Resolution

    • To modify the behavior:
      1. Apply the following product update corresponding to the product used
        • The issue is resolved in Service Pack 2 or above for Crystal Reports for Visual Studio 2010
        • The issue is resolved in Service Pack 4 or above for Crystal Reports 2008
      2. Add the registry key: UseOriginalHyphen, and set the value to: 1
        • Go to the Microsost Windows Registry Editor
        • Navigate to:  
          •  
          • For 64bit: 
          • HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Business Objects\Suite 12.0\Crystal Reports\Export\RTF
          •  
          • For 32bit:
          • HKEY_LOCAL_MACHINE\SOFTWARE\Business Objects\Suite 12.0\Crystal Reports\Export\RTF
          •  
          • Note that the keys at the end of the path will most likely not exits, you have to add the keys manually.
        • Add a DWORD Value, and name it: UseOriginalHyphen
        • Set the value to: 1
      3. Now, when exporting to the following format, you will then be able to copy paste strings of characters that contains hyphen
        • RTF format, or
        • MS Word (97-2003)
    • Limitation: It will not work for the format: Microsoft Word (97-2003) - Editable. The suggestion is to export the report to RTF format.

     

    Keywords

    rich text format CR2010 2010 CR4VS2010 CR4VS VS2010 NET2010 Crystal Reports for .NET Framework 4.0 crforvs 13 asci modify modified wrong char , KBA , BI-DEV-NET-SDK , .NET SDK / COM SDK , Problem

    Product

    Crystal Reports 2008 V1 ; SAP Crystal Reports, developer version for Microsoft Visual Studio