# Binding with FlexReport

Get started with FlexReport, a WinForms control, which is a fast-paced reporting engine that enables you to create, preview, export and print modern and dynamic reports for all your applications. See more in documentation here.

## Content



The purpose of binding FlexReport with FlexViewer is to view the FlexReport in FlexViewer control. To bind the FlexReport with FlexViewer control, you first need to create a report definition (.flxr) and load it in C1FlexReport object. Once the report definition is loaded in C1FlexReport, it can be viewed in the FlexViewer control. C1FlexViewer allows you to bind FlexReport with the FlexViewer control using DocumentSource property of C1FlexViewer class. The DocumentSource property takes the value from C1FlexReport object, which contains the report definition.

![Snapshot of FlexViewer](https://cdn.mescius.io/document-site-files/images/96483bc4-d0db-40fa-a0e4-c5e6a4a56825/images/bind-flexreport-viewer.png)

To preview the report in FlexViewer control, use the following code:

```csharp
FlexReport flexReport = new FlexReport();
flexReport.Load(@"../../Resources/FlexDataBinding.flxr", "SimpleData");
DataSource ds1 = new DataSource();
ds1.Name = "Main";
ds1.DataProvider = DataProvider.OLEDB;
ds1.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Resources\\C1NWind.mdb;Persist Security Info=False";
ds1.RecordSource = "Products";
ds1.RecordSourceType = RecordSourceType.TableDirect;
flexReport.DataSources.Add(ds1);
flexViewer.DocumentSource = flexReport;
```