Back to Devexpress

Export to Image

xtrareports-2581-feature-guide-to-devexpress-reports-store-and-distribute-reports-export-reports-export-to-image.md

latest10.4 KB
Original Source

Export to Image

  • Feb 18, 2026
  • 5 minutes to read

This document describes how to export a report document to Image format.

You can export a report from the Report Designer’s Preview and the Document Viewer on all supported platforms (WinForms, WPF, ASP.NET Web Forms, ASP.NET MVC, and ASP.NET Core). To do this, expand the Export Document drop-down list and select Image File. Specify export options in the invoked dialog, and click OK.

To export a report document to Image format in code, use one of the following approaches:

Export a Report

Call an XtraReport.ExportToImage overloaded method to export a report. To export a report asynchronously in a separate task, call an XtraReport.ExportToImageAsync overloaded method instead. To specify export options, create a ImageExportOptions class instance and pass this instance to the invoked method, or use XtraReport ‘s ExportOptions.Image property.

csharp
using System;
using DevExpress.XtraPrinting;
using DevExpress.XtraReports.UI;
// ...
XtraReport report = new XtraReport() {
    Name = "HelloWorld",
    Bands = {
        new DetailBand(){
            Controls={
                new XRLabel(){
                    Text="Hello World!"
                }
            }
        }
    }
};
// imageExportFile specifies the exported file's name and path. The user's Downloads folder is used as the default path.
string imageExportFile = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + @"\Downloads\" + report.Name + ".image";
// Specify export options to export the report.
// Uncomment the lines below to specify export options in an ImageExportOptions class instance.
// ImageExportOptions ImageExportOptions = new ImageExportOptions();
// ImageExportOptions.ExportMode = ImageExportMode.SingleFile;
// report.ExportToImage(imageExportFile, ImageExportOptions);

// Comment the lines below if you specified export options in an ImageExportOptions class instance above.
report.ExportOptions.Image.ExportMode = ImageExportMode.SingleFile;
report.ExportToImage(imageExportFile);
vb
Imports System
Imports DevExpress.XtraPrinting
Imports DevExpress.XtraReports.UI
' ...
Private report As New XtraReport() With {
    .Name = "HelloWorld", .Bands = {
        New DetailBand() With {
            .Controls={
                New XRLabel() With {.Text="Hello World!"}
            }
        }
    }
}
' imageExportFile specifies the exported file's name and path. The user's Downloads folder is used as the default path.
Private imageExportFile As String = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) & "\Downloads\" & report.Name & ".image"
' Specify export options and export the report.
' Uncomment the lines below to specify export options in an ImageExportOptions class instance.
' ImageExportOptions ImageExportOptions = new ImageExportOptions();
' ImageExportOptions.ExportMode = ImageExportMode.SingleFile;
' report.ExportToImage(imageExportFile, ImageExportOptions);

' Comment the lines below if you specified export options in an ImageExportOptions class instance above.
report.ExportOptions.Image.ExportMode = ImageExportMode.SingleFile
report.ExportToImage(imageExportFile)

Export a Document

Call a PrintingSystem.ExportToImage overloaded method to export a document. To specify export options, create a ImageExportOptions class instance and pass this instance to the invoked method, or use PrintingSystem ‘s ExportOptions.Image property.

csharp
using System;
using DevExpress.XtraPrinting;
using DevExpress.XtraReports.UI;
// ...
XtraReport report = new XtraReport() {
    Name = "HelloWorld",
    Bands = {
        new DetailBand(){
            Controls={
                new XRLabel(){
                    Text="Hello World!"
                }
            }
        }
    }
};
// Create a document from the report.
report.CreateDocument();
// imageExportFile specifies the exported file's name and path. The user's Downloads folder is used as the default path.
string imageExportFile = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + @"\Downloads\" + report.Name + ".image";
// Specify export options and export the document.
// Uncomment the lines below to specify export options in an ImageExportOptions class instance.
// ImageExportOptions ImageExportOptions = new ImageExportOptions();
// ImageExportOptions.ExportMode = ImageExportMode.SingleFile;
// report.PrintingSystem.ExportToImage(imageExportFile, ImageExportOptions);

// Comment the lines below if you specified export options in an ImageExportOptions class instance above.
report.PrintingSystem.ExportOptions.Image.ExportMode = ImageExportMode.SingleFile;
report.PrintingSystem.ExportToImage(imageExportFile);
vb
Imports System
Imports DevExpress.XtraPrinting
Imports DevExpress.XtraReports.UI
' ...
Private report As New XtraReport() With {
    .Name = "HelloWorld", .Bands = {
        New DetailBand() With {
            .Controls={
                New XRLabel() With {.Text="Hello World!"}
            }
        }
    }
}
' Create a document from the report.
report.CreateDocument()
' imageExportFile specifies the exported file's name and path. The user's Downloads folder is used as the default path.
Dim imageExportFile As String = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) & "\Downloads\" & report.Name & ".image"
' Specify export options and export the document.
' Uncomment the lines below to specify export options in an ImageExportOptions class instance.
' ImageExportOptions ImageExportOptions = new ImageExportOptions();
' ImageExportOptions.ExportMode = ImageExportMode.SingleFile;
' report.PrintingSystem.ExportToImage(imageExportFile, ImageExportOptions);

' Comment the lines below if you specified export options in an ImageExportOptions class instance above.
report.PrintingSystem.ExportOptions.Image.ExportMode = ImageExportMode.SingleFile
report.PrintingSystem.ExportToImage(imageExportFile)

Export a Control

Call a PrintingLink.ExportToImage overloaded method to export a control. To specify export options, create a ImageExportOptions class instance and pass this instance to the invoked method.

csharp
using System;
using DevExpress.XtraPrinting;
using DevExpress.XtraReports.UI;
// ...
DevExpress.XtraCharts.ChartControl chart = new DevExpress.XtraCharts.ChartControl() {
    Name = "IncomeByQuarter",
    Series = {
        new DevExpress.XtraCharts.Series("2019", DevExpress.XtraCharts.ViewType.Bar)
    }
};
// Create a printing link.
PrintingSystem printingSystem = new PrintingSystem();
PrintableComponentLink link = new PrintableComponentLink();
printingSystem.Links.Add(link);
link.Component = chart;
// imageExportFile specifies the exported file's name and path. The user's Downloads folder is used as the default path.
string imageExportFile = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + @"\Downloads\" + chart.Name + ".image";
// Specify export options and export the control.
ImageExportOptions ImageExportOptions = new ImageExportOptions();
ImageExportOptions.ExportMode = ImageExportMode.SingleFile;
link.ExportToImage(imageExportFile, ImageExportOptions);
vb
Imports System
Imports DevExpress.XtraPrinting
Imports DevExpress.XtraReports.UI
' ...
Private chart As New DevExpress.XtraCharts.ChartControl() With {
    .Name = "IncomeByQuarter", .Series = { New DevExpress.XtraCharts.Series("2019", DevExpress.XtraCharts.ViewType.Bar) }
}
' Create a printing link.
Private printingSystem As New PrintingSystem()
Private link As New PrintableComponentLink()
printingSystem.Links.Add(link)
link.Component = chart
' imageExportFile specifies the exported file's name and path. The user's Downloads folder is used as the default path.
Dim imageExportFile As String = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) & "\Downloads\" & chart.Name & ".image"
' Specify export options and export the control.
Dim ImageExportOptions As New ImageExportOptions()
ImageExportOptions.ExportMode = ImageExportMode.SingleFile
link.ExportToImage(imageExportFile, ImageExportOptions)

Settings and Limitations

The options that can be specified for a document exported to an image are stored in the ImageExportOptions class. Use the report’s ExportOptions.Image property to access these options.

To specify the text rendering quality, especially in low-DPI images and in images with transparent background, use the ImageExportOptions.TextRenderingMode property.

The following image formats are supported:

  • BMP
  • EMF (not supported on Linux )
  • WMF (not supported on Linux )
  • GIF
  • JPEG
  • PNG
  • TIFF
  • SVG

A report watermark appears in the exported image only in SingleFilePageByPage or DifferentFiles export modes.