Working with FlexReport > Data Binding in FlexReport > Retrieving Data from a Database |
For retrieving or loading the report data in FlexReport, following DataSource properties of C1FlexReport should be set:
To set data source:
'initialize data source Dim ds As DataSource = C1FlexReport1.DataSource ds.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\...\ComponentOne Samples\Common\C1Nwind.mdb;" ds.RecordSource = "Employees"
//initialize DataSource DataSource ds = c1FlexReport1.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. This is same as initializing data source through the code or the designer as illustrated in Step 1 of 4: Creating a Report Definition.