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

XRRichText.LoadFile(String, XRRichTextStreamType) Method

Loads a specific type of file into the XRRichText control.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v18.2.dll

Declaration

public void LoadFile(
    string path,
    XRRichTextStreamType streamType
)

Parameters

Name Type Description
path String

A String containing a path to the file to be loaded into the XRRichText control.

streamType XRRichTextStreamType

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

Remarks

The LoadFile method supports the following file extensions: .htm, .html, .rtf, .txt and .docx.

The loaded file’s content replaces the XRRichText control’s entire contents.

The following example demonstrates how to create an XRRichText object in code and load its content from a file.

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

// Create an XRRichText object.
XRRichText xrRichText1 = new XRRichText();

// Set its height to be calculated automatically,
// and make its borders visible.
xrRichText1.CanGrow = true;
xrRichText1.CanShrink = true;
xrRichText1.Borders = DevExpress.XtraPrinting.BorderSide.All;

// Load the control content from a file.
xrRichText1.LoadFile("input.docx", XRRichTextStreamType.XmlText);
See Also