# Upgrading C1Report to FlexReport

Easily understand the two simple ways to upgrade or convert your existing C1Report report definition (.xml) to C1FlexReport report definition (.flxr). See more demos, documentation, and samples here.

## Content

The reports created using **C1Report** are fully compatible with [C1FlexReport](/componentone/docs/win/online-flexreport/). The following are the two simple ways to upgrade or convert your existing C1Report report definition (.xml) to C1FlexReport report definition (.flxr):

### Upgrading C1Report report definition in the designer

1. Run **C1FlexReportDesigner.8.exe or C1FlexReportDesigner.4.8.exe**.
2. Go to **File\|Open** and select the C1Report report definition (.xml) that you want to upgrade. You will see the following dialog box:
    ![Upgrading C1Report to FlexReport](https://cdn.mescius.io/document-site-files/images/fd2ea167-30cb-4938-9938-b740a5b4dd95/imagesext/upgradeinfo_c1reportinflexreportdesigner.png)
3. Click **OK**.
4. Go to **File \| Save**.
5. In the **Save Report Definition File** dialog box, specify the **File name** and click **Save**.

The report definition is saved as type **.flxr**. Your report definition is now converted from C1Report's .xml to C1FlexReport's .flxr.

### Upgrading the existing C1Report Windows Application Project to FlexReport Windows Application Project in Visual Studio

1. Open the existing Windows App that contains C1Report (.xml) file.
2. Delete C1Report from the Form.
3. Delete C1Report's previewing control C1PrintPreview or C1RibbonPreviewControl from the Form.
4. Add [C1FlexReport](/componentone/docs/win/online-flexreport/) component to the **Toolbox**:
    1. Right-click a tab and select **Choose items...** A **Choose Toolbox Items** dialog box appears.
    2. Click Browse and select **C1.Win.FlexReport.8.dll** or **C1.Win.FlexReport.4.8.dll** from the bin folder. The **C1FlexReport** component will be added in the Toolbox.
5. Add **FlexViewer** control to the **Toolbox**:
    1. Right-click a tab and select **Choose items...** A **Choose Toolbox Items** dialog box appears.
    2. Click Browse and select **C1.Win.FlexViewer.8.dll** or **C1.Win.FlexViewer.4.8.dll** from the bin folder. The FlexViewer control will be added in the **Toolbox**.
6. Drop **C1FlexReport** on the Form. The following dlls with the same version as the version of C1FlexReport should get added to the references:
    * C1.C1Pdf
    * C1.Win
    * C1.Win.BarCode
    * C1.Win.C1Document
    * C1.Win.FlexReport

    If these references do not have the same version, you need to add them manually.
7. Drop FlexViewer control on the Form. The following dlls with the same version as the version of C1FlexViewer should get added to the references:
    * C1.C1Zip
    * C1.Win.C1DX
    * C1.Win.C1Ribbon
    * C1.Win.FlexViewer
    * C1.Win.ImportServices

    If these references do not have the same version, you need to add them manually.
8. Add the following dlls to the references:
    * C1.C1Word
    * C1.C1Excel
    * C1.Win.C1Chart
    * C1.Win.C1Chart3D

    To use map and super-label custom fields, add following dlls to the references:
    * C1.Win.FlexReport.CustomFields
    * C1.WPF.Maps
    * C1.WPF
9. Rename **C1Report** component to **C1FlexReport** component. In code, you can change the name of the component as follows:
    **vbnet**

    ```vbnet
    Dim report As New C1Report()
    'To
    Dim report As New C1FlexReport()
    ```

    **csharp**
    
  ```csharp
    C1Report report = new C1Report();
    //To
    C1FlexReport report = new
    C1FlexReport();
  ```

10. Change the name of namespace from C1.C1Report to **C1.Win.FlexReport** in code-behind.
11. Delete all references to the dlls of C1Report and its dependencies - C1.C1Report, C1.Win.C1Report, C1.Win.C1Barcode, and C1.Win.C1RibbonPreview.
12. Delete namespace C1.Win.C1Preview.
13. Delete license entires of C1Report and the referenced viewer (C1Preview or C1RibbonPreview) from licenses.licx.
14. In order to bind C1FlexReport with C1FlexViewer, following code will have to be changed as follows:
    **vbnet**

    ```vbnet
    Dim c1r As C1.C1Report.C1Report = New C1Report()
    c1r.Load(filepath, reportname)
    C1PrintPreviewControl1.Document = clr
    'To
    Dim report As New C1FlexReport()
    report.Load(filepath, reportname)
    C1FlexViewer1.DocumentSource = report
    ```

    **csharp**

    ```csharp
    C1.C1Report.C1Report c1r = new C1Report();
    c1r.Load(filepath, reportname);
    c1PrintPreviewControl1.Document=clr;
    //To
    C1FlexReport report = new C1FlexReport();
    report.Load(filepath, reportname);
    c1FlexViewer1.DocumentSource = report;
    ```

>type=note
> Note that FlexReport can be previewed at runtime by using FlexViewer control only. The FlexViewer control is not compatible with C1PrintPreviewControl or C1RibbonPreviewControl.