ActiveReports 18 .NET Edition
Developers / Working with Reports / Page/RDLX Report / Create a Report or Load an Existing Report
In This Topic
    Create a Report or Load an Existing Report
    In This Topic

    This topic discusses about creating and loading a Page or an RDLX report in designer using code. We recommend you to create a new report directly from the standalone designer or you using the built-in project templates from Visual Studio.

    Create a Report

    Use NewReport() method in the Designer 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.   

    C#. Add using statements on the top of Form.cs
    Copy Code
    using System.Windows.Forms;
    using GrapeCity.ActiveReports.Design;
    
    C# code. Paste INSIDE the Form Load event.
    Copy Code
    var _designer = new Designer() { Dock = DockStyle.Fill };
    _designer.NewReport(DesignerReportType.Section);
    Controls.Add(_designer);
    

    For details on using additional Designer class methods, properties, and events, refer to this page.

    Load an Existing Report

    Use the DefaultResourceLocator class especially in case when you are dealing with master reports (RDLX reports). You can create a new report with the master report and load it in the designer as shown. Make sure to add MESCIUS.ActiveReports.Core.Rdl package to your project.

    C#. Add using statements on the top of Form.cs
    Copy Code
    using System.Windows.Forms;
    using GrapeCity.ActiveReports.Design;
    using GrapeCity.ActiveReports;
    
    C# code. Paste INSIDE the Form Load event.
    Copy Code
    var _designer = new Designer() { Dock = DockStyle.Fill };
    _designer.ResourceLocator = new DefaultResourceLocator(new Uri(path to master));
    _designer.LoadReport(new FileInfo(path to report));
    

     

    See Also