Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

XRDesignMdiController.CreateNewReportWizard() Method

In This Article

Invokes the Report Wizard.

Namespace: DevExpress.XtraReports.UserDesigner

Assembly: DevExpress.XtraReports.v24.2.Extensions.dll

NuGet Package: DevExpress.Win.Reporting

#Declaration

public void CreateNewReportWizard()

#Remarks

This example demonstrates how to invoke the Report Wizard by calling the XRDesignMdiController.CreateNewReportWizard method.

After the report has been created, it is saved to a temporary file, where it can be later reconstructed and previewed.

Imports System
Imports System.Windows.Forms
Imports DevExpress.XtraReports.UI
Imports DevExpress.XtraReports.UserDesigner
' ...

Namespace docNewReportWizard
    Partial Public Class Form1
        Inherits Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub simpleButton1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles simpleButton1.Click
            Dim fileName As String = CreateReport()

            Me.BeginInvoke(New MethodInvoker(Sub() PreviewReport(fileName)))
        End Sub

        Private Function CreateReport() As String
            Dim fileName As String = "temp.repx"
            Dim form As New XRDesignForm()
            form.DesignMdiController.CreateNewReportWizard()
            form.ActiveDesignPanel.BeginInvoke(New MethodInvoker(Sub() form.ActiveDesignPanel.Report.SaveLayout(fileName)))
            Return fileName
        End Function
        Private Sub PreviewReport(ByVal fileName As String)
            Dim newReport As XtraReport = XtraReport.FromFile(fileName, True)
            newReport.ShowPreview()
        End Sub

    End Class
End Namespace
See Also