ActiveReports 16 .NET Edition
ActiveReports 16 User Guide / Concepts / Page Report/RDL Report Concepts / Data Binding / Connect to a Data Source / CSV Provider
In This Topic
    CSV Provider
    In This Topic

    This article explains connecting a Page or an RDL report to a CSV data source.

    Connect to a CSV Data Source

    1. In the designer, go to the Report Explorer, right-click the Data Sources node and select the Add Data Source option or click the Add button and then select the Data Source option.
    2. In the Report Data Source dialog that appears, select the General page and enter the name of the data source in the Name field. By default, the data source name is set to DataSource1. This name appears as a child node to the Data Sources node in the Report Explorer.
    3. Under the Type field, select Csv Provider.
    4. In the Connection String tab, click the Build icon to open the Configure CSV Data Source dialog.
      Configure CSV Data Source Wizard
    5. To specify the Path of the file, click the Open button and navigate to the desired folder on your system. For example, you can connect to the MyOrders.csv sample datasource which can be downloaded from GitHub.
    6. Select the Column Separator as Comma from the drop-down menu. 
    7. Click the Get from Preview button to fill the Columns area with the column names (or fields) and their corresponding data types (string by default). 
      For more information, see the Configuration Properties for CSV Data Source section.
    8. Click OK to save the changes and close the Configure CSV Data Source dialog. 
      Configure CSV Data Source Wizard

      The Connection String tab displays the generated connection string as shown below:
      Connection String
      Copy Code
      You can validate the connection string by clicking the Validate DataSource icon.            
    9.  Click OK to close the Report Data Source dialog. Your report is now connected to the CSV data source successfully.

    Configuration Settings for CSV Data Source

    The CSV Data Provider provides the following configuration settings in the Configure CSV Data Source dialog. Based on the defined configuration settings, the CSV connection string is generated. 

    Setting Description Example
    Path Path to the CSV file - both local and relative; or a URL for centrally located CSV data sources. C:\MyOrders.csv
    Encoding Specify the character encoding used in the CSV file. Unicode (UTF-8)
    Locale Specify the locale used in the CSV file. English (United States)
    File Type

    Define the type of CSV file. You can choose from Fixed and Delimited options.

    Starting Row Row number to start fetching data. 0
    Text Qualifiers Character to specify where the text begins and ends, that is, the character that encloses values in the CSV file. You can choose from Quotes and Single quotes options. Quotes
    Columns have headers Specify whether the CSV file has columns with headers or not. Checked
    Column Separator Specify the symbol used to separate the columns in the CSV file. You can choose from Comma, Semicolon, Tab, and Space options. Comma
    Row Separator Symbol used to separate the rows in the CSV file. You can choose from CRLF (carriage return and line feed), CR (carriage return), and LF (line feed) new line formats. New line (CRLF)
    Treat consecutive as one Specify whether to join the column separators or row separators as one. Checked for Column separator

    Unchecked for Row Separator
    Get from preview

    Fills the Columns area with names and data types (string by default) for columns present in the CSV file. You can customize the column names and specify the data type for each column. The data types supported are:

    • String - Stores alphanumeric characters
    • Boolean - Stores true or false values
    • DateTime - Stores both date and time values
    • Integer - Stores integer values ranging from -2,147,483,648 to 2,147,483,647
    • Float - Stores decimal numbers with single precision
    • Decimal - Stores exact numeric value with fixed precision and scale
    • Double - Stores decimal numbers with double precision
    • Long - Stores integer values ranging from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
    Note: Text QualifiersColumn Separator, Row Separator, and Treat Consecutive as one options are not available for Fixed file type.
    See Also