Back to Devexpress

CsvExportOptions.FollowReportLayout Property

corelibraries-devexpress-dot-xtraprinting-dot-csvexportoptions-73cc995c.md

latest3.3 KB
Original Source

CsvExportOptions.FollowReportLayout Property

Specifies if CSV export should follow the report layout.

Namespace : DevExpress.XtraPrinting

Assembly : DevExpress.Printing.v25.2.Core.dll

NuGet Package : DevExpress.Printing.Core

Declaration

csharp
[Browsable(false)]
[DefaultValue(true)]
public static bool FollowReportLayout { get; set; }
vb
<Browsable(False)>
<DefaultValue(True)>
Public Shared Property FollowReportLayout As Boolean

Property Value

TypeDefaultDescription
Booleantrue

true , to follow the report layout in CSV export; false otherwise.

|

Property Paths

You can access this nested property as listed below:

Object TypePath to FollowReportLayout
ExportOptions

.Csv .FollowReportLayout

|

Remarks

Set FollowReportLayout to true to add a column to a CSV export file for each space between report controls. Use the CsvExportOptions.SkipEmptyRows and CsvExportOptions.SkipEmptyColumns properties to specify if CSV export should skip empty rows and columns.

Example

The code sample below shows how to prohibit the CSV export from following the report layout:

csharp
using DevExpress.XtraPrinting;
using DevExpress.XtraReports.UI;
// ...
public bool ExportReport(XtraReport report, string filename) {
    try {
        var options = new CsvExportOptions();
        options.SkipEmptyColumns = false;
        options.SkipEmptyRows = false;
        CsvExportOptions.FollowReportLayout = false;
        report.ExportToCsv(filename, options);
        return true;
    }
    catch {
        return false;
    }
}
vb
Imports DevExpress.XtraPrinting
Imports DevExpress.XtraReports.UI
' ...
Public Function ExportReport(ByVal report As XtraReport, ByVal filename As String) As Boolean
    Try
        Dim options = New CsvExportOptions()
        options.SkipEmptyColumns = False
        options.SkipEmptyRows = False
        CsvExportOptions.FollowReportLayout = False
        report.ExportToCsv(filename, options)
        Return True
    Catch
        Return False
    End Try
End Function

See Also

SkipEmptyColumns

SkipEmptyRows

CsvExportOptions Class

CsvExportOptions Members

DevExpress.XtraPrinting Namespace