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

XtraReport Class

A DevExpress report.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v24.2.dll

NuGet Package: DevExpress.Reporting.Core

#Declaration

public class XtraReport :
    XtraReportBase,
    ISupportInitialize,
    IServiceProvider,
    IServiceContainer,
    IReport,
    IDocumentSource,
    ILink,
    IComponent,
    IDisposable,
    IExtensionsProvider,
    IParameterSupplier,
    IParameterSupplierBase,
    IRootXmlObject,
    IReportEvents

The following members return XtraReport objects:

Show 59 links
Library Related API Members
WPF Controls GridReportManagerService.GenerateReport(XtraReport)
IReportManagerService.GenerateReport(XtraReport)
IReportManagerService.GetReport(ReportInfo)
IReportProvider.GetReport()
IReportProvider.GetReport(String)
IReportSerializer.Load(Stream)
IReportStorage.CreateNew()
IReportStorage.CreateNewSubreport()
IReportStorage.Load(String, IReportSerializer)
IWizardReportProvider.NewReport
IWizardReportProvider.OriginalReport
ReportClonedEventArgs.Cloned
ReportClonedEventArgs.Original
ReportDesignerDocument.Report
ReportManagerService.GenerateReport(XtraReport)
ReportManagerService.GetReport(ReportInfo)
StandaloneReportManagerService.GenerateReport(XtraReport)
Dashboard CustomExportEventArgs.Report
CustomExportWebEventArgs.Report
.NET Reporting Tools CachedReportSourceWeb.Report
DrillThroughContext.Report
DrillThroughResult.Report
GetValueEventArgs.Report
IReportJsonSerializer.DeserializeFromJson(String)
IReportProvider.GetReport(String, ReportProviderContext)
IReportResolver.Resolve(String, Boolean)
IWebDocumentViewerDrillThroughProcessor.CreateReport(DrillThroughContext)
IWebDocumentViewerReportResolver.Resolve(String)
NavigateToReportAction.ReportSource
ReportCacheItem.Report
ReportDesignTool.Report
ReportGenerator.GenerateReport(BaseView, ReportGenerationOptions, Boolean)
ReportGenerator.GenerateReport(BaseView, ReportGenerationOptions)
ReportGenerator.GenerateReport(BaseView)
ReportGenerator.GenerateReport(XtraReport, BaseView, ReportGenerationOptions, Boolean)
ReportGenerator.GenerateReport(XtraReport, BaseView)
ReportProviderContext.LoadReport(Byte[])
ReportProviderContext.ReportSource
ReportProviderContext.RootReport
ReportWizardCustomizationService.TryCreateCustomReport(XtraReportModel, Object, String, CustomWizardData, XtraReport)
SubreportBase.ReportSource
XRControl.RootReport
XRCrossBandControl.RootReport
XRDesignPanel.Report
XtraReport.FromFile(String, Boolean)
XtraReport.FromStream(Stream, Boolean)
XtraReport.FromXmlFile(String, Boolean)
XtraReport.FromXmlStream(Stream, Boolean)
XtraReport.MasterReport
XAF: Cross-Platform .NET App UI & Web API CreateCustomReportDesignRepositoryItemEventArgs.Report
IReportContainer.Report
IReportStorage.GetReport(String)
IReportStorage.LoadReport(IReportDataV2)
ReportContainer.Report
ReportStorageBase.GetReport(String)
ReportStorageBase.LoadReport(IReportDataV2)
ReportWebViewerDetailItem.Report
ASP.NET MVC Extensions DocumentViewerSettings.Report
ReportViewerSettings.Report

#Remarks

For general information on DevExpress Reporting, refer to the following topic: Get Started with DevExpress Reporting.

#Create a Report

You can use the Visual Studio Report Designer to create reports for most common scenarios. You can also create and customize reports in code. See the following documents for more information on both methods:

#Display a Prepared Report in Your Application

DevExpress Reporting ships with the Document Viewer and the End-User Report Designer components for the following Microsoft platforms:

  • WinForms
  • WPF
  • ASP.NET Web Forms
  • ASP.NET MVC
  • ASP.NET Core
  • Blazor Server – includes a native viewer and a JavaScript-based viewer and designer.
  • WinUI – includes a viewer only.

Each component includes an API that accepts an XtraReport class instance. You can create an instance of your report in code and use this API to pass your report to the Document Viewer or open it in the End-User Report Designer.

The following example shows how to display a report in the WinForms Document Viewer control:

using DevExpress.XtraReports.UI;
//...

ReportPrintTool printTool = new ReportPrintTool(new XtraReport1());
printTool.ShowRibbonPreview();

The example below demonstrates how to open a report in the ASP.NET Core Document Viewer:

C#
@{
    var viewerRender = Html.DevExpress().WebDocumentViewer("DocumentViewer")
        .Height("1000px")
        .Bind(new XtraReport1());
    @viewerRender.RenderHtml()
}

You can find a list of all available platforms and more information on each of them in the following documentation section: Integrate a Report into the User Interface.

The Report Designer serializes your report while you create it in Visual Studio. This serialization mechanism allows you to create an instance of your report in code. You can then export or print the created report without showing it in the Document Viewer. The latter also applies to reports created in code from scratch.

The following example creates a report instance and exports it to PDF:

using System;
//..

var report = new XtraReport1();
report.ExportToPdf(Environment.GetFolderPath(
    Environment.SpecialFolder.UserProfile) + @"\Downloads\Report1.pdf"
);

Refer to the following document for more information: Print and Export Reports without a Preview.

#Implements

See Also