Working with FlexReport > Data Binding in FlexReport > Retrieving Data from a Database |
For retrieving the report data in FlexReport, following DataSource properties of C1FlexReport should be set:
To set data source, use the following code:
Dim rep As New C1FlexReport() 'initialize DataSource Dim ds As DataSource = rep.DataSource ds.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\...\ComponentOne Samples\Common\C1NWind.mdb;" ds.RecordSource = "Employees"
C1FlexReport rep = new C1FlexReport(); //initialize DataSource DataSource ds = rep.DataSource; ds.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\...\ComponentOne Samples\Common\C1NWind.mdb;"; ds.RecordSource = "Employees";
If these properties are set, C1FlexReport initializes the data source and uses them to load the data from the database automatically.