SAP Knowledge Base Article - Public

2496421 - Number of decimals not retained when exporting a report to CSV format, from Crystal Reports

Symptom

  • Missing decimal values.
  • Number rounded to 2 decimals.
  • Percentage value formatted to display more than 2 decimals, are only showing 2 decimals in MS Excel.
  • Only 2 decimals are displayed for percentage, when opening in MS Excel a report exported to CSV format from Crystal Reports.
  • Numbers that are not displaying percentages displays more than 2 decimals when exported to CSV format from Crystal Reports.

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. Insert a percentage summary.
  3. Format the percentage value to display more than 2 decimals, like: 85.1234%
  4. Export the report to CSV format.
  5. When opening the exported report in MS Excel, it truncate the value to 2 decimals like:  85.12%

Cause

  • This situation only occurs for percentage values.
  • Crystal Reports exports the whole percentage value with all it's decimals to CSV format as expected, but when the CSV file generated is open, it is MS Excel that automatically format the percentage values to display 2 decimals.

 

Resolution

  • To view the percentage value with more than 2 decimals, perform one of the following:
         
    • Open the CSV file in a text application, like Notepad, to see the percentage values with all the decimals, or
          
    • If you want to view the exported report in MS Excel, then export to "MS Excel (97-2003) - Data Only" format, instead of CSV format.

Keywords

CR, xport , 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