SAP Knowledge Base Article - Public

3066882 - Database Field Names show as: F1, F2, F3,... when connecting to a text or csv file using an ODBC connection in Crystal Reports

Symptom

  • Field names show as generic headers like: F1, F2, F3
  • When connecting to a text or a csv file, using the MS Text ODBC driver, the database field name show as F1, F2, F3,... in Crystal Reports.
  • Expect the database field names to use the name of the column headers defined in the text or csv file, but it shows as a generic name in Crystal Reports.
  • How to set the database field names in Crystal Reports to use the column headers defined in the txt or csv file?

Environment

  • SAP Crystal Reports 2013
  • SAP Crystal Reports 2016
  • SAP Crystal Reports 2020 

Reproducing the Issue

  1. In the Microsoft ODBC Data Source Administrator, create an ODBC DSN, to a text or csv file using the MS Text ODBC driver.
  2. In Crystal Reports, create a new report.
  3. In the Database Expert, under "Create New Connection", double click on "ODBC (RDO)"
  4. Select the ODBC DSN created in step 1, that connect to the text or csv file, and click "Next"
  5. Notice all the database field names, display as: F1, F2, F3,... 
    How to set the database field names to use the column headers defined in the txt or csv file?

Cause

  • Crystal Reports simply receives the database field name from the ODBC connection to the text, or csv file.
  • It is the Microsoft Text ODBC Driver configuration that determine what is the name of the database fields.
  • When database field names show as generic headers, like F1, F2, F3,.... it indicates the ODBC DSN using the Microsoft Text Driver is not configured to use the first row of the text file as Column Header.

Resolution

  • In the MS ODBC Data Source Administrator, configure the ODBC DSN using the Microsoft Text Driver ODBC driver, to use the first row of the file as the column headers.
        
    1. Launch the 32bit or 64bit of MS ODBC Data Source Administrator, corresponding to the version of Crystal Reports used:
      • 32bit, for Crystal Reports 2013, 2016
      • 64bit, for Crystal Reports 2020
            
    2. Under "System DSN", select the ODBC DSN that points to the text, or csv file, and click "Configure..."
           
    3. In the window "ODBC Text Setup", click on the button "Options>>"
        
    4. At the bottom of the screen, click on the button: "Define Format..."

         ODBC TExt Driver - 01.png
         
        
    5. In "Define Text Format", select the text, or csv file, you want to view the definition.
           
    6. Check the option "Column Name Header"
       
        ODBC TExt Driver - 02.png 
          
           
    7. Click "OK" to accept the change.
          
    8. Back to the "ODBC Text Setup", ckick on "OK" to accept the change.

Keywords

CR, MS Text ODBC driver , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , Problem

Product

SAP Crystal Reports 2013 ; SAP Crystal Reports 2016 ; SAP Crystal Reports 2020