Skip to main content
A newer version of this page is available. .

Cross-Platform Reporting

  • 3 minutes to read

This document describes the functionality available for console or web server applications that do not provide any GUI and which you can use without referencing any platform-specific libraries.

Direct Printing

You can use the PrintToolBase.Print method to implement printing in a console or web server application that does not provide any GUI, for example:

using DevExpress.XtraPrinting;
using DevExpress.XtraReports.UI;
using System.Drawing.Printing;
// ...

static void Main(string[] args) {
    var settings = new PrinterSettings();
    var printer = settings.PrinterName;

    var report = new XtraReport1();
    report.PrinterName = printer;
    report.CreateDocument();
    PrintToolBase tool = new PrintToolBase(report.PrintingSystem);
    tool.Print();
}

Tip

The PrintToolBase class does not reference any WinForms or other platform-specific components.

Direct Export

You can use the XtraReport class methods to implement exporting in a console or web server application that does not provide any GUI, for example:

using DevExpress.XtraReports.UI;
using System.Web.Mvc;
using System.IO;
// ...

public ActionResult ExportPdf() {
    XtraReport report = new Reports.SampleReport();
    MemoryStream ms = new MemoryStream();
    report.ExportToPdf(ms);
    return File(ms.ToArray(), "application/pdf");
}

Tip

You do not need to reference any WinForms or other platform-specific components to use these methods in your application.

Libraries Required for Report Printing and Exporting

The following libraries are required to print or export a report.

Required Assembly Description
DevExpress.Data.v18.2.dll Implements the most basic functionality common to all DevExpress controls.
DevExpress.Printing.v18.2.Core.dll Contains classes that implement the basic functionality for DevExpress printing libraries.
DevExpress.XtraReports.v18.2.dll Contains the XtraReport class.
Optional Assembly Description
DevExpress.Charts.v18.2.Core.dll Required only if a report contains at least one XRChart control.
DevExpress.CodeParser.v18.2.dll Required to process report scripts.
DevExpress.DataAccess.v18.2.dll Required only if a report is bound to an SQL or Entity Framework data source.
DevExpress.Office.v18.2.Core.dll Required for report export to DOCX, or when a report contains at least one XRRichText control.
DevExpress.Pdf.v18.2.Core.dll Required only for report export to PDF.
DevExpress.PivotGrid.v18.2.Core.dll Required only if a report contains at least one XRPivotGrid control.
DevExpress.RichEdit.v18.2.Core.dll Required for report export to DOCX, or when a report contains at least one XRRichText control.
DevExpress.RichEdit.v18.2.Export.dll Required for report export to DOCX.
DevExpress.Sparkline.v18.2.Core.dll Required only if a report contains at least one XRSparkline control.
DevExpress.Xpo.v18.2.dll Required only if a report is bound to an SQL or Entity Framework data source.
DevExpress.XtraCharts.v18.2.dll Required only if a report contains at least one XRChart control.