# Binding with FlexReport

Learn how to bind a report to the FlexViewer control. See more demos, documentation, and samples here.

## Content



To render a report, you need to bind the report to the **FlexViewer** control. Once the report definition has been created, a data source defined, and loaded into the FlexReport component, you can render the report using FlexViewer.

To preview the report in the **FlexViewer** control, the steps are as follows:

1.  From the **Toolbox**, double-click the **FlexViewer** control to add it to your project.
2.  From the **Properties** window, set the **C1FlexViewer.Dock** property to Fill.
3.  Select the Windows Form with your mouse and drag to resize it. For this example, we resized the Form to 600 x 500 so it better reveals the preview panel.
4.  Double-click the form and enter the following code in the **Form\_Load** event handler: **vbnet**
    
    ```vbnet
    'load report definition
    c1FlexReport1.Load("..\..\Products Report.flxr", "Products Report")
    'preview the report
    c1FlexViewer1.DocumentSource = c1FlexReport1
    ```
    
    **csharp**
    
    ```csharp
    //load report definition
    c1FlexReport1.Load(@"..\..\Products Report.flxr", "Products Report");
    //preview the report
    c1FlexViewer1.DocumentSource = c1FlexReport1;
    ```
    
5.  Press F5 to run the application. Observe the output.
    
    ![](https://cdn.mescius.io/document-site-files/images/fd2ea167-30cb-4938-9938-b740a5b4dd95/images/renderingareport.png)