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

XRRichText.LoadFile(Stream, XRRichTextStreamType) Method

SECURITY NOTE

Do not load files obtained from untrusted sources. Such files may pose a security risk. Please review the following article for additional information:
Suppress Control Requests to Download Data from External URLs

Loads the contents of a data stream into the XRRichText control.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v24.2.dll

NuGet Package: DevExpress.Reporting.Core

#Declaration

public void LoadFile(
    Stream data,
    XRRichTextStreamType streamType
)

#Parameters

Name Type Description
data Stream

A Stream of data to load into the XRRichText control.

streamType XRRichTextStreamType

An XRRichTextStreamType enumeration value that specifies the type of stream used to load data into the XRRichText control.

#Remarks

A user can specify a stream type to load files of a particular format into the XRRichText control. The contents of the control are replaced with the newly loaded data.

The following code snippet loads a data stream in DOCX format into the XRRichText control:

public partial class XtraReport1 : DevExpress.XtraReports.UI.XtraReport {
    public XtraReport3() {
        InitializeComponent();
        System.IO.Stream stream = File.OpenRead("test.docx");
        // ...
        // You can modify data contained in the open stream.
        // ...
        this.xrRichText1.LoadFile(stream, XRRichTextStreamType.XmlText);
    }
}
See Also