Bind a Section Report to CSV Data Source
In This Topic
This walkthrough illustrates binding a section report to a CSV data source.
The walkthrough is split up into the following activities:
- Adding an ActiveReport to the Visual Studio project
- Connecting to a data source
- Creating a layout for the report
- Viewing the report
Note: This walkthrough uses the
Products_header_tab.csv sample database. The Products_header_tab.csv file can be downloaded from
GitHub: ..\Samples14\Data\NWIND.mdb.
When you complete this walkthrough you get a layout that looks similar to the following at design time and at run time.
Design-Time Layout
Report bound to CSV data source - design time
Run-Time Layout
Report bound to CSV data source - run time
To add an ActiveReport to the Visual Studio project
- Create a new Visual Studio project.
- From the Project menu, select Add New Item.
- In the Add New Item dialog that appears, select ActiveReports 14 Section Report (code-based) and in the Name field, rename the file as rptProductsStock.
- Click the Add button to open a new section report in the designer.
See Quick Start for information on adding different report layouts.
To connect the report to a data source
- On the section band, click the Data Source icon.
- In the Report Data Source dialog, on the CSV tab, click the Build button next to Connection String.
- To specify the File Path, click the Open button and navigate to the Products_header_tab.csv file.
- Select the Column Separator as Tab from the drop-down menu. See the Sample CSV Connection String drop-down in CSV Data Provider topic for further details.
- Click OK to save the changes and close the Configure CSV Data Source wizard. The Connection String tab displays the generated connection string as shown below:
Path=C:\\[User folder]\\Samples14\\Data\\Products_header_tab.csv;Locale=en-US;
TextQualifier=";ColumnsSeparator= ;RowsSeparator=\r\n;HasHeaders=True
- Click OK to close the Report Data Source dialog. You have successfully connected the report to the CSV data source.
To view the report
- Click the to view the report at design time.
OR
See Also