Back to Devexpress

XRControlStyleSheet.SaveToFile(String) Method

xtrareports-devexpress-dot-xtrareports-dot-ui-dot-xrcontrolstylesheet-dot-savetofile-x28-system-dot-string-x29.md

latest2.9 KB
Original Source

XRControlStyleSheet.SaveToFile(String) Method

SECURITY-RELATED CONSIDERATIONS

Using file paths sourced from untrusted input may expose unauthorized files or allow unintended file access. Always validate and normalize all external paths to prevent path manipulation.

Saves the styles contained in the given XRControlStyleSheet object to a file.

Namespace : DevExpress.XtraReports.UI

Assembly : DevExpress.XtraReports.v25.2.dll

NuGet Package : DevExpress.Reporting.Core

Declaration

csharp
public void SaveToFile(
    string fileName
)
vb
Public Sub SaveToFile(
    fileName As String
)

Parameters

NameTypeDescription
fileNameString

A string containing the full path to the file (including the file name and extension) in which the styles will be saved.

|

Remarks

All saved styles can be loaded by the XRControlStyleSheet.LoadFromFile method.

If a file with the specified name already exists in the given destination directory the existing file will be overwritten.

Example

This example demonstrates how the XRControlStyleSheet.SaveToFile method works.

csharp
path = Application.StartupPath + @"\..\..\Styles\";

private void button1_Click(object sender, EventArgs e) {
    report.StyleSheet.SaveToFile(path + "currentStyleSheet.repss");
}
vb
path = Application.StartupPath & "\..\..\Styles\"

Private Sub button1_Click(ByVal sender As Object, _ 
ByVal e As EventArgs) Handles button1.Click
    report.StyleSheet.SaveToFile(path & "currentStyleSheet.repss")
End Sub

See Also

SaveToStream(Stream)

LoadFromFile(String)

Report Visual Styles

Store Report Style Sheets

XRControlStyleSheet Class

XRControlStyleSheet Members

DevExpress.XtraReports.UI Namespace