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

MapControl.ExportToRtf(String) Method

Exports the Map Control’s data to a file in RTF format.

Namespace: DevExpress.XtraMap

Assembly: DevExpress.XtraMap.v24.2.dll

NuGet Package: DevExpress.Win.Map

#Declaration

public void ExportToRtf(
    string filePath
)

#Parameters

Name Type Description
filePath String

A string that specifies the full path to the file the Map Control’s data will be exported to.

#Remarks

This method exports the current map as a *.RTF file to the specified path calling the PrintingSystemBase.ExportToRtf method. After creating a RTF file, the map can be displayed in an appropriate application. For more information, refer to the PrintingSystemBase.ExportToRtf topic.

Note

The MapControl’s data can only be exported if the XtraPrinting Library is available.

#Example

To export a map image to a file, use one of the following methods.

private void ddbExport_Click(object sender, EventArgs e) {
    string filepath = filepathBase + exportFormat.ToString();
    switch (exportFormat) {
        case (ExportFormat.Image):
            mapControl.ExportToImage(filepath, ImageFormat.Jpeg);
            break;
        case (ExportFormat.Mht):
            mapControl.ExportToMht(filepathBase);
            break;
        case (ExportFormat.Pdf):
            mapControl.ExportToPdf(filepathBase);
            break;
        case (ExportFormat.Xls):
            mapControl.ExportToXls(filepathBase);
            break;
        case (ExportFormat.Xlsx):
            mapControl.ExportToXlsx(filepathBase);
            break;
        default:
            MessageBox.Show("Export to a *" + exportFormat.ToString() + " file format is impossible.", "Export to " + exportFormat.ToString());
            return;
    }

    MessageBox.Show("Export to a *" + exportFormat.ToString() + " file is done.", "Export to " + exportFormat.ToString());
}
See Also