# Create a Report or Load an Existing Report

Learn how to use an empty report as a template in Visual Studio to create a new section report.

## Content

This topic discusses about creating and loading a Section Report (xml or code based) in designer using code. We recommend you to create a new report directly from [the standalone designer](/activereportsnet/docs/v20.1/report-authors/design-reports/design-section-reports/tutorials-section-report-scenarios) or you using the [built-in project templates](/activereportsnet/docs/v20.1/devops/install-activereports) from Visual Studio.

### Create a Report

Use [NewReport()](/activereportsnet/api/v20.1/MESCIUS.ActiveReports.Design.Win/GrapeCity.ActiveReports.Design.Designer.html) method in the [Designer](/activereportsnet/api/v20.1/MESCIUS.ActiveReports.Design.Win/GrapeCity.ActiveReports.Design.Designer.html) class to initialize the designer with a new report layout, with specified type. Make sure to add **MESCIUS.ActiveReports.Design.Win** package to your project.

```csharp.
using System.Windows.Forms;
using GrapeCity.ActiveReports.Design;
```

```csharp
var _designer = new Designer() { Dock = DockStyle.Fill };
_designer.NewReport(DesignerReportType.Section);
Controls.Add(_designer);
```

### Load an RPX file at Design Time

1. From the Visual Studio **\> Report** menu, select **Load Layout**.

    >type=note
> **Note**: The **Report** menu in **Visual Studio 2019** and above is available as submenu under **Extensions**. You should select the **Design View** of the report in the ActiveReports Designer first.
2. In the **Open** dialog that appears, navigate to the location of the .rpx file and select it.
3. Click the **Open** button to load the report layout.

### Load an RPX file into the ActiveReports Viewer at Run Time

Use the [LoadLayout(XmlReader)](/activereportsnet/api/v20.1/MESCIUS.ActiveReports/GrapeCity.ActiveReports.SectionReport.html) method to load your report layout at run time.

1. Right-click on the Windows Form and select **View Code** to see the code view for the Windows form.
2. Add the following code to the form class to load a report.
<br>
    The following examples show what the code for the method looks like.

    ```vbnet
    Dim rpt As New GrapeCity.ActiveReports.SectionReport()
    ' For the code to work, this report.rpx must be stored in the bin\debug folder of your project.
    Dim xtr As New System.Xml.XmlTextReader(Application.StartupPath + "\report.rpx")
    rpt.LoadLayout(xtr)
    xtr.Close()
    Viewer1.Document = rpt.Document
    rpt.Run()
    ```

    ```csharp
    GrapeCity.ActiveReports.SectionReport rpt = new GrapeCity.ActiveReports.SectionReport();
    // For the code to work, this report.rpx must be stored in the bin\debug folder of your project.
    System.Xml.XmlTextReader xtr = new System.Xml.XmlTextReader(Application.StartupPath + "\\report.rpx");
    rpt.LoadLayout(xtr);
    xtr.Close();
    viewer1.Document = rpt.Document;
    rpt.Run();
    ```

## See Also

[Draw on the Canvas of Rendered Report](/activereportsnet/docs/v20.1/developers/working-with-reports-devs/section-report-developers/draw-on-the-canvas)

#### Developers

[Load Reports](/activereportsnet/docs/v20.1/developers/create-applications/dotnet-viewer-application/working-with-win-viewer/load-reports-in-win-viewer)