Back to Devexpress

XtraReport Class

xtrareports-devexpress-dot-xtrareports-dot-ui-79e5ca9d.md

latest19.1 KB
Original Source

XtraReport Class

A DevExpress report.

Namespace : DevExpress.XtraReports.UI

Assembly : DevExpress.XtraReports.v25.2.dll

NuGet Package : DevExpress.Reporting.Core

Declaration

csharp
[DXLicenseReporting]
public class XtraReport :
    XtraReportBase,
    ISupportInitialize,
    IServiceProvider,
    IServiceContainer,
    IReport,
    IDocumentSource,
    ILink,
    IComponent,
    IDisposable,
    IExtensionsProvider,
    IParameterSupplier,
    IParameterSupplierBase,
    IRootXmlObject,
    IReportEvents
vb
<DXLicenseReporting>
Public Class XtraReport
    Inherits XtraReportBase
    Implements ISupportInitialize,
               IServiceProvider,
               IServiceContainer,
               IReport,
               IDocumentSource,
               ILink,
               IComponent,
               IDisposable,
               IExtensionsProvider,
               IParameterSupplier,
               IParameterSupplierBase,
               IRootXmlObject,
               IReportEvents

The following members return XtraReport objects:

Show 24 links

LibraryRelated API Members
WPF ControlsGridReportManagerService.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)
XAF: Cross-Platform .NET App UI & Web APICreateCustomReportDesignRepositoryItemEventArgs.Report
IReportContainer.Report
IReportStorage.GetReport(String)
IReportStorage.LoadReport(IReportDataV2)
ReportContainer.Report
ReportStorageBase.GetReport(String)
ReportStorageBase.LoadReport(IReportDataV2)

The following members return XtraReport objects:

Show 50 links

LibraryRelated API Members
WPF ControlsGridReportManagerService.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)
DashboardCustomExportEventArgs.Report
CustomExportWebEventArgs.Report
.NET Reporting ToolsCachedReportSourceWeb.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
PromptToReportRequest.Instance
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

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:

  • Create a Report in Visual Studio – explains how to get started with the Visual Studio Report Designer.
  • Create a Report in Code – a detailed guide on how to create reports in code.
  • DevExpress Reports Feature Guide – the documents in this section contain detailed information on how to work with reports (bind to data, use report controls, export, and more) in the Report Designer. Most of the documents also explain how to do it in code.

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.

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 displays a report in the WinForms Document Viewer control:

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

ReportPrintTool printTool = new ReportPrintTool(new XtraReport1());
printTool.ShowRibbonPreview();
vb
Imports DevExpress.XtraReports.UI
'...

Private printTool As New ReportPrintTool(New XtraReport1())
printTool.ShowRibbonPreview()

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

@{
    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:

csharp
using System;
//..

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

Private 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

IScriptable

IReport

Inheritance

Object MarshalByRefObject Component XRControl Band XtraReportBase XtraReport XtraSchedulerReport

Extension Methods

Show 12 items

ShowDesigner()

ShowDesignerDialog()

ShowDesigner(UserLookAndFeel)

ShowDesignerDialog(UserLookAndFeel)

ShowDesigner(UserLookAndFeel, DesignDockPanelType)

ShowDesignerDialog(UserLookAndFeel, DesignDockPanelType)

ShowRibbonDesigner()

ShowRibbonDesignerDialog()

ShowRibbonDesigner(UserLookAndFeel)

ShowRibbonDesignerDialog(UserLookAndFeel)

ShowRibbonDesigner(UserLookAndFeel, DesignDockPanelType)

ShowRibbonDesignerDialog(UserLookAndFeel, DesignDockPanelType)

See Also

XtraReport Members

DevExpress.XtraReports.UI Namespace