[]
        
(Showing Draft Content)

CSV Provider

This article explains connecting a section report to a CSV data source.

Connect to a CSV Data Source

  1. In the designer, select the Data Source icon on the Detail section of the report or click the gray area around the design surface and select the Edit Data Source link in the Properties pane.

  2. In the Report Data Source dialog that appears, select the CSV tab to connect to a CSV data source.

  3. Click the Build button next to the Connection String section to open the Configure CSV Data Source dialog box.


  4. 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 data source which can be downloaded from GitHub.

  5. Select the Column Separator as Comma from the drop-down menu.

  6. Click the Get from Preview button to fill the Columns area with the column names and their corresponding data types (string by default) present in the CSV file. This allows you to modify the name and data type (like String, Boolean, DateTime, Integer, Float, Decimal, Double, or Long) for the columns.

    For more information, see the Configuration Properties for CSV Data Source section.

  7. Click the OK button to save the changes and close the Configure CSV Data Source dialog.


    The Connection String section displays the generated connection string as shown below:

    Path=C:\\MyOrders.csv;Locale=en-IN;TextQualifier=";ColumnsSeparator=,;RowsSeparator=\r\n;Columns=ID,Product,Customer,OrderNumber,Stock,Total(Decimal),UnitPrice(Decimal),City,ProductLine,Discount(Decimal);HasHeaders=True
  8. Click the OK button 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.

Note: Text Qualifiers, Column Separator, Row Separator, and Treat Consecutive as one options are not available for Fixed file type.

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.

Delimited

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 Auto Detect, CRLF (carriage return and line feed), CR (carriage return), and LF (line feed) new line formats.

Auto Detect

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. This allows you to modify the name and data type (like String, Boolean, DateTime, Integer, Float, Decimal, Double, or Long) for the columns.

UnitPrice(Decimal)