When I save a report with data as a CSV file, all of the leading zeros are cut off any numbers when I open the file in Excel. How can I keep the zeros?

This is actually an Excel issue. The program automatically truncates all leading zeros from numbers in CSV files. The key is to change at least the columns where the leading zeros occur (i.e. ORG or Fund numbers) to "text." There are two ways to accomplish this.

First and simplest way: If the report needs to be .csv, save the entire report as Excel. Then open the Excel document, convert the whole sheet to text format, and save as .csv.

Second and more 'surgical' way: Start with the report open:

  1. Click on Export icon > Export Data to CSV and the Save as CSV Options box opens.
  2. Set the Text qualifier as either double or single quotes.
  3. Set the Column delimiter as a comma.
  4. Click OK.
  5. Click Save -- DO NOT OPEN THE CSV FILE DIRECTLY WITH EXCEL!
  6. Open a new worksheet in Excel (see below for Excel screenshots.)
  7. Select the Data tab.
  8. Click on the From text icon to display the Import Text File dialog box.
  9. Select the CSV file to import and click Import. The Text Import Wizard appears.
  10. Select the Delimited radio button -- Text Import Wizard, Step 1 determines that your data is delimited.
  11. Select the row number where you want the import to start.
  12. Check the My data has headers. box if true. Review the preview of the file at the bottom of the box.
  13. Click Next
  14. Check "Comma" as a delimiter (column dividers will appear in preview)-- Step 2 lets you set delimiters
  15. Click Next
  16. Highlight the column(s) with leading zeros in Step 3
  17. Mark those columns format as "text" by clicking the radio button in the Column Data Format section.  NOTE: You will need to do this for each column where the data contains leading zeros.
  18. Click Finish, Import Data dialog box opens.
  19. Click OK.
  20. The leading zeros will still be there in the new worksheet with the imported data. The columns with real numbers will still be able to be used with calculations.

Successive screen shots of Excel process: