xtrareports-devexpress-dot-xtrareports-dot-userdesigner-dot-reportdesignersettings.md
Specifies how report elements snap and align to each other.
Namespace : DevExpress.XtraReports.UserDesigner
Assembly : DevExpress.XtraReports.v25.2.dll
NuGet Package : DevExpress.Reporting.Core
[DefaultValue(SnappingMode.SnapLines)]
public SnappingMode SnappingMode { get; set; }
<DefaultValue(SnappingMode.SnapLines)>
Public Property SnappingMode As SnappingMode
| Type | Default | Description |
|---|---|---|
| SnappingMode | SnapLines |
A SnappingMode enumeration value that specifies the snapping mode.
|
Available values:
| Name | Description |
|---|---|
| None |
No snapping is used.
| | SnapLines |
Represents the snapping mode, which aligns a report element using snap lines.
| | SnapToGrid |
Represents the snapping mode, which aligns a report element to the report snap grid.
| | SnapToGridAndSnapLines |
Represents the snapping mode, which aligns a report element to both the snap grid and snap lines.
|
You can access this nested property as listed below:
| Object Type | Path to SnappingMode |
|---|---|
| ReportSettingsBase |
.DesignerSettings .SnappingMode
|
The following code sample creates an End-User Designer instance and specifies default settings for its reports:
using DevExpress.XtraReports.UI;
using DevExpress.Drawing.Printing;
using DevExpress.XtraReports.UserDesigner;
// ...
XRDesignForm form = new XRDesignForm();
XRDesignMdiController reportDesigner = form.DesignMdiController;
// Report Page Settings
reportDesigner.DefaultReportSettings.PaperKind = DXPaperKind.Letter;
reportDesigner.DefaultReportSettings.Landscape = true;
reportDesigner.DefaultReportSettings.RollPaper = false;
reportDesigner.DefaultReportSettings.ReportUnit = ReportUnit.HundredthsOfAnInch;
reportDesigner.DefaultReportSettings.Margins = new System.Drawing.Printing.Margins(50, 50, 100, 100);
// Report Font Settings
reportDesigner1.DefaultReportSettings.Font = new DevExpress.Drawing.DXFont("Arial", 12f);
// Report Export Settings
reportDesigner.DefaultReportSettings.ExportSettings.FileName = "TestReport";
reportDesigner.DefaultReportSettings.ExportSettings.ExportFormat = DevExpress.XtraPrinting.ExportFormat.Xlsx;
// Report Layout Settings
reportDesigner.DefaultReportSettings.DesignerSettings.DrawGrid = false;
reportDesigner.DefaultReportSettings.DesignerSettings.SnappingMode = DevExpress.XtraReports.UI.SnappingMode.SnapToGridAndSnapLines;
form.ShowDialog();
Imports DevExpress.XtraReports.UI
Imports DevExpress.Drawing.Printing
Imports DevExpress.XtraReports.UserDesigner
' ...
Private form As New XRDesignForm()
Private reportDesigner As XRDesignMdiController = form.DesignMdiController
' Report Page Settings
reportDesigner.DefaultReportSettings.PaperKind = DXPaperKind.Letter
reportDesigner.DefaultReportSettings.Landscape = True
reportDesigner.DefaultReportSettings.RollPaper = False
reportDesigner.DefaultReportSettings.ReportUnit = ReportUnit.HundredthsOfAnInch
reportDesigner.DefaultReportSettings.Margins = New System.Drawing.Printing.Margins(50, 50, 100, 100)
' Report Font Settings
reportDesigner1.DefaultReportSettings.Font = New DevExpress.Drawing.DXFont("Arial", 12F)
' Report Export Settings
reportDesigner.DefaultReportSettings.ExportSettings.FileName = "TestReport"
reportDesigner.DefaultReportSettings.ExportSettings.ExportFormat = DevExpress.XtraPrinting.ExportFormat.Xlsx
' Report Layout Settings
reportDesigner.DefaultReportSettings.DesignerSettings.DrawGrid = False
reportDesigner.DefaultReportSettings.DesignerSettings.SnappingMode = DevExpress.XtraReports.UI.SnappingMode.SnapToGridAndSnapLines
form.ShowDialog()
See Also