ActiveReports 19 .NET Edition
MESCIUS.ActiveReports.Design.Win Assembly / GrapeCity.ActiveReports.Design Namespace / Designer Class / NewReport Method
Example

In This Topic
    NewReport Method
    In This Topic
    Initializes the designer with a new report layout.
    Overload List
    OverloadDescription
    Initializes the designer with a new report layout.  
    Initializes the designer with a new report layout with specified type.  
    Initializes the designer with a new report layout of the specified type and, if requested, launches the Data Source Dialog. This method facilitates the creation of a new report by allowing the specification of the report type (e.g., Section, Page) and provides an option to immediately launch the Data Source Dialog, which assists in setting up data connections and queries for the report.  
    Example
    /// <summary>
    /// NewReport - an Interface function from IPlugInHost
    /// </summary>
    /// <param name="name">Name to use for the Document</param>
    /// <returns>Current report object in the designer</returns>
    public object NewReport(string name)
    {    
        try
        {
            this.ardMain.NewReport();
            this.ardMain.Report.Document.Name = name;
            return this.ardMain.Report;
        }
        catch(GrapeCity.ActiveReports.ReportException)
        {
            MessageBox.Show("Error occurred while creating new report", "Error in Diamond Reports");
            return null;
        }
        
    }
    'NewReport - an Interface function from IPlugInHost
    'Parameter Name: name - Name to use for the Document
    'Returns: Current report object in the designer
    Public Function NewReport(ByVal name As String) As Object Implements IPlugInHost.NewReport
        Try
            Me.ardMain.NewReport()
            Me.ardMain.Report.Document.Name = name
            Return Me.ardMain.Report
        Catch ex As GrapeCity.ActiveReports.ReportException
            MessageBox.Show("Error occurred while creating new report", "Error in Diamond Reports")
            Return Nothing
        End Try
    End Function 'NewReport
    See Also