menu

MAUI

  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class DataGridPdfExportingOption - MAUI API Reference | Syncfusion

    Show / Hide Table of Contents

    Class DataGridPdfExportingOption

    Represents a class which is used to set the exporting options for the excel. User can pass this class as an argument to the ExportToPdf(SfDataGrid, DataGridPdfExportingOption) for customizing data exported to the pdf.

    Inheritance
    System.Object
    DataGridPdfExportingOption
    Namespace: Syncfusion.Maui.DataGrid.Exporting
    Assembly: Syncfusion.Maui.DataGridExport.dll
    Syntax
    public class DataGridPdfExportingOption : Object

    Constructors

    DataGridPdfExportingOption()

    Initializes a new instance of the class.

    Declaration
    public DataGridPdfExportingOption()

    Properties

    BottomTableSummaryStyle

    Gets or sets the style to be applied for the exporting bottom table summaries in the grid.

    Declaration
    public PdfGridCellStyle BottomTableSummaryStyle { get; set; }
    Property Value
    Type Description
    PdfGridCellStyle

    The style to be applied for the exporting bottom table summaries in the grid.

    Examples
    DataGridPdfExportingController pdfExport = new DataGridPdfExportingController();
    DataGridPdfExportOption pdfExportOption = new DataGridPdfExportOption();
    pdfExportOption.BottomTableSummaryStyle = new PdfGridCellStyle()
    {
        Borders = new PdfBorders() { All = new PdfPen(new PdfColor() { B = 5 }) }
    };
    var doc = pdfExport.ExportToPdf(this.dataGrid, pdfExportOption);

    CanApplyGridStyle

    Gets or sets a value indicating whether the grid style of the datagrid need to be exported or not.

    Declaration
    public bool CanApplyGridStyle { get; set; }
    Property Value
    Type Description
    System.Boolean

    A boolean value specifying whether the grid style of the datagrid need to be exported or not. The default value is false.

    Remarks

    Grid Styles are not exported when user sets the properties like GroupCaptionStyle, HeaderStyle, RecordStyle, etc for exporting.

    Examples
    DataGridPdfExportingController pdfExport = new DataGridPdfExportingController();
    DataGridPdfExportOption pdfExportOption = new DataGridPdfExportOption();
    pdfExportOption.FitAllColumnsInOnePage = true;
    var doc = pdfExport.ExportToPdf(this.dataGrid, pdfExportOption);

    CanAutoFitRowHeight

    Gets or sets a value indicating whether the row height of pdf table can be auto calculated based its cells contents. if not, default row height or datagrid row height will be assigned based on ExportRowHeight.

    Declaration
    public bool CanAutoFitRowHeight { get; set; }
    Property Value
    Type Description
    System.Boolean

    A boolean value specifying whether the row heights can be auto caculated to based on its content. The default value is false.

    Examples
    DataGridPdfExportingController pdfExport = new DataGridPdfExportingController();
    DataGridPdfExportOption pdfExportOption = new DataGridPdfExportOption();
    pdfExportOption.AutoFitRowHeight = false;
    var doc = pdfExport.ExportToPdf(this.dataGrid, pdfExportOption);

    CanExportAllPages

    Gets or sets a value indicating whether all the pages in the SfDataPager should be exported or not.

    Declaration
    public bool CanExportAllPages { get; set; }
    Property Value
    Type Description
    System.Boolean

    The boolean value specifying whether all the pages in the SfDataPager should be exported or not. The default value is false.

    Examples
    DataGridPdfExportingController pdfExport = new DataGridPdfExportingController();
    DataGridPdfExportOption pdfExportOption = new DataGridPdfExportOption();
    pdfExportOption.ExportAllPages = true;
    var doc = pdfExport.ExportToPdf(this.dataGrid, pdfExportOption);

    CanExportColumnWidth

    Gets or sets a value indicating whether the column widths can be exported or not, if not default column width will be assigned.

    Declaration
    public bool CanExportColumnWidth { get; set; }
    Property Value
    Type Description
    System.Boolean

    A boolean value whether the column widths can be exported or not, if not default column width will be assigned. The default value is true.

    Examples
    DataGridPdfExportingController pdfExport = new DataGridPdfExportingController();
    DataGridPdfExportOption pdfExportOption = new DataGridPdfExportOption();
    pdfExportOption.ExportColumnWidth = false;
    var doc = pdfExport.ExportToPdf(this.dataGrid, pdfExportOption);

    CanExportGroups

    Gets or sets a value indicating whether the groups in the SfdataGrid is to be exported or not.

    Declaration
    public bool CanExportGroups { get; set; }
    Property Value
    Type Description
    System.Boolean

    A boolean value specifying whether the groups in the SfdataGrid is to be exported or not. The default value is true.

    Examples
    DataGridPdfExportingController pdfExport = new DataGridPdfExportingController();
    DataGridPdfExportOption pdfExportOption = new DataGridPdfExportOption();
    pdfExportOption.ExportGroups = false;
    var doc = pdfExport.ExportToPdf(this.dataGrid, pdfExportOption);

    CanExportGroupSummary

    Gets or sets a value indicating whether the group summary rows should be exported or not.

    Declaration
    public bool CanExportGroupSummary { get; set; }
    Property Value
    Type Description
    System.Boolean

    The boolean value specifying whether the group summary rows should be exported or not. The default value is true.

    Examples
    DataGridPdfExportingController pdfExport = new DataGridPdfExportingController();
    DataGridPdfExportOption pdfExportOption = new DataGridPdfExportOption();
    pdfExportOption.ExportGroupSummary = false;
    var doc = pdfExport.ExportToPdf(this.dataGrid, pdfExportOption);

    CanExportHeader

    Gets or sets a value indicating whether the header is to be exported or not.

    Declaration
    public bool CanExportHeader { get; set; }
    Property Value
    Type Description
    System.Boolean

    A boolean value specifying whether the header is to be exported or not. By default the value is true.

    Examples
    DataGridPdfExportingController pdfExport = new DataGridPdfExportingController();
    DataGridPdfExportOption pdfExportOption = new DataGridPdfExportOption();
    pdfExportOption.ExportHeader = false;
    var doc = pdfExport.ExportToPdf(this.dataGrid, pdfExportOption);

    CanExportRowHeight

    Gets or sets a value indicating whether the row heights can be exported or not, if not default row height will be assigned.

    Declaration
    public bool CanExportRowHeight { get; set; }
    Property Value
    Type Description
    System.Boolean

    A boolean value specifying whether the row heights can be exported or not, if not default row height will be assigned. The default value is true.

    Examples
    DataGridPdfExportingController pdfExport = new DataGridPdfExportingController();
    DataGridPdfExportOption pdfExportOption = new DataGridPdfExportOption();
    pdfExportOption.ExportRowHeight = false;
    var doc = pdfExport.ExportToPdf(this.dataGrid, pdfExportOption);

    CanExportStackedHeaders

    Gets or sets a value indicating whether the is to be exported or not.

    Declaration
    public bool CanExportStackedHeaders { get; set; }
    Property Value
    Type Description
    System.Boolean

    A boolean value specifying whether the StackedHeaderRows is to be exported or not. By default the value is false.

    Examples
    DataGridPdfExportingController pdfExport = new DataGridPdfExportingController();
    DataGridPdfExportOption pdfExportOption = new DataGridPdfExportOption();
    pdfExportOption.ExportStackedHeaders = false;
    var doc = pdfExport.ExportToPdf(this.dataGrid, pdfExportOption);

    CanExportSwitchColumnAsFormFields

    Gets or sets a value indicating whether the switch or checkbox columns can exported as checkbox form fields. Otherwise, true or false string will get printed in table cell. will get printed in table cell.

    Declaration
    public bool CanExportSwitchColumnAsFormFields { get; set; }
    Property Value
    Type Description
    System.Boolean

    A boolean value specifying whether the switch columns can be exported as checkbox form fields to pdf. The default value is true.

    Examples
    DataGridPdfExportingController pdfExport = new DataGridPdfExportingController();
    DataGridPdfExportOption pdfExportOption = new DataGridPdfExportOption();
    pdfExportOption.ExportSwitchColumnAsFormFields = false;
    var doc = pdfExport.ExportToPdf(this.dataGrid, pdfExportOption);

    CanExportTableSummary

    Gets or sets a value indicating whether the table summary rows should be exported or not.

    Declaration
    public bool CanExportTableSummary { get; set; }
    Property Value
    Type Description
    System.Boolean

    The boolean value specifying whether the table summary rows should be exported or not. The default value is true.

    Examples
    DataGridPdfExportingController pdfExport = new DataGridPdfExportingController();
    DataGridPdfExportOption pdfExportOption = new DataGridPdfExportOption();
    pdfExportOption.ExportTableSummary = false;
    var doc = pdfExport.ExportToPdf(this.dataGrid, pdfExportOption);

    CanExportUnboundRows

    Gets or sets the value which indicates whether the UnboundRows should be exported or not

    Declaration
    public bool CanExportUnboundRows { get; set; }
    Property Value
    Type
    System.Boolean

    CanFitAllColumnsInOnePage

    Gets or sets a value indicating whether all the columns should be fit on a page or not.

    Declaration
    public bool CanFitAllColumnsInOnePage { get; set; }
    Property Value
    Type Description
    System.Boolean

    A boolean value specifying whether all the columns should be fit on a page or not. By default the value is false.

    Examples
    DataGridPdfExportingController pdfExport = new DataGridPdfExportingController();
    DataGridPdfExportOption pdfExportOption = new DataGridPdfExportOption();
    pdfExportOption.FitAllColumnsInOnePage = true;
    var doc = pdfExport.ExportToPdf(this.dataGrid, pdfExportOption);

    CanRepeatHeaders

    Gets or sets a value indicating whether the headers can be repeated in each page or not

    Declaration
    public bool CanRepeatHeaders { get; set; }
    Property Value
    Type Description
    System.Boolean

    A boolean value specifying whether the headers can be repeated in each page or not. By default the value is true.

    Columns

    Gets or internal sets the System.Collections.IEnumerable columns collection containing all the columns in the datagrid excluding the columns in the ExcludedColumns list.

    Declaration
    public IEnumerable<DataGridColumn> Columns { get; }
    Property Value
    Type Description
    System.Collections.Generic.IEnumerable<DataGridColumn>

    The System.Collections.IEnumerable columns collection containing all the columns in the datagrid excluding the columns in the ExcludedColumns list.

    DefaultColumnWidth

    Gets or sets the default column width for exporting. The default column width will be applied for exporting when ExportColumnWidth is false.

    Declaration
    public float DefaultColumnWidth { get; set; }
    Property Value
    Type Description
    System.Single

    The default column width for exporting. The default value is 50.

    Examples
    DataGridPdfExportingController pdfExport = new DataGridPdfExportingController();
    DataGridPdfExportOption pdfExportOption = new DataGridPdfExportOption();
    pdfExportOption.DefaultColumnWidth = 60;
    var doc = pdfExport.ExportToPdf(this.dataGrid, pdfExportOption);

    DefaultRowHeight

    Gets or sets the default row height for exporting. The default row height will be applied for exporting when ExportRowHeight is false.

    Declaration
    public float DefaultRowHeight { get; set; }
    Property Value
    Type Description
    System.Single

    The default row height for exporting. The default value is 50.

    Examples
    DataGridPdfExportingController pdfExport = new DataGridPdfExportingController();
    DataGridPdfExportOption pdfExportOption = new DataGridPdfExportOption();
    pdfExportOption.DefaultRowHeight = 60;
    var doc = pdfExport.ExportToPdf(this.dataGrid, pdfExportOption);

    ExcludeColumns

    Gets or sets the System.Collections.IEnumerable columns collection containing all the columns in the SfdataGrid excluding the columns in the ExcludedColumns list.

    Declaration
    public List<string> ExcludeColumns { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.List<System.String>

    The System.Collections.IEnumerable columns collection containing all the columns in the SfdataGrid excluding the columns in the ExcludedColumns list.

    ExcludedColumns

    Gets or sets the list of columns that to be excluded from exporting.

    Declaration
    public List<string> ExcludedColumns { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.List<System.String>

    The list of columns that to be excluded from exporting.

    Examples
    DataGridPdfExportingController pdfExport = new DataGridPdfExportingController();
    DataGridPdfExportOption pdfExportOption = new DataGridPdfExportOption();
    pdfExportOption.ExcludedColumns.Add("CustomerID");
    
    var doc = pdfExport.ExportToPdf(this.dataGrid, pdfExportOption);

    GridLineType

    Gets or sets the type of grid line to be exported.

    Declaration
    public GridLineType GridLineType { get; set; }
    Property Value
    Type Description
    GridLineType

    The type of grid line to be exported. The default value is Both.

    Examples
    DataGridPdfExportingController pdfExport = new DataGridPdfExportingController();
    DataGridPdfExportOption pdfExportOption = new DataGridPdfExportOption();
    pdfExportOption.GridLineType = GridLineType.Vertical;
    var doc = pdfExport.ExportToPdf(this.dataGrid, pdfExportOption);

    GroupCaptionStyle

    Gets or sets the style to be applied for the exporting group caption summaries in the grid.

    Declaration
    public PdfGridCellStyle GroupCaptionStyle { get; set; }
    Property Value
    Type Description
    PdfGridCellStyle

    The style to be applied for the exporting group caption summaries in the grid.

    Examples
    DataGridPdfExportingController pdfExport = new DataGridPdfExportingController();
    DataGridPdfExportOption pdfExportOption = new DataGridPdfExportOption();
    pdfExportOption.GroupCaptionStyle = new PdfGridCellStyle()
    {
        Borders = new PdfBorders() { All = new PdfPen(new PdfColor() { B = 5 }) }
    };
    var doc = pdfExport.ExportToPdf(this.dataGrid, pdfExportOption);

    GroupSummaryStyle

    Gets or sets the style to be applied for the exporting group summaries in the grid.

    Declaration
    public PdfGridCellStyle GroupSummaryStyle { get; set; }
    Property Value
    Type Description
    PdfGridCellStyle

    The style to be applied for the exporting group summaries in the grid.

    Examples
    DataGridPdfExportingController pdfExport = new DataGridPdfExportingController();
    DataGridPdfExportOption pdfExportOption = new DataGridPdfExportOption();
    pdfExportOption.GroupSummaryStyle = new PdfGridCellStyle()
    {
        Borders = new PdfBorders() { All = new PdfPen(new PdfColor() { B = 10 }) }
    };
    var doc = pdfExport.ExportToPdf(this.dataGrid, pdfExportOption);

    HeaderStyle

    Gets or sets the style to be applied for the exporting header in the grid.

    Declaration
    public PdfGridCellStyle HeaderStyle { get; set; }
    Property Value
    Type Description
    PdfGridCellStyle

    The style to be applied for the exporting header in the grid.

    Examples
    DataGridPdfExportingController pdfExport = new DataGridPdfExportingController();
    DataGridPdfExportOption pdfExportOption = new DataGridPdfExportOption();
    pdfExportOption.HeaderStyle = new PdfGridCellStyle()
    {
        CellPadding = new PdfPaddings() { All = 5 }
    };
    var doc = pdfExport.ExportToPdf(this.dataGrid, pdfExportOption);

    PdfDocument

    Gets or sets the pdf document for exporting the data in the grid.

    Declaration
    public PdfDocument PdfDocument { get; set; }
    Property Value
    Type Description
    PdfDocument

    The pdf document for exporting the data in the grid.

    RecordStyle

    Gets or sets the style to be applied for the exporting record in the grid.

    Declaration
    public PdfGridCellStyle RecordStyle { get; set; }
    Property Value
    Type Description
    PdfGridCellStyle

    The style to be applied for the exporting record in the grid.

    Examples
    DataGridPdfExportingController pdfExport = new DataGridPdfExportingController();
    DataGridPdfExportOption pdfExportOption = new DataGridPdfExportOption();
    pdfExportOption.RecordStyle = new PdfGridCellStyle()
    {
        CellPadding = new PdfPaddings() { All = 5 }
    };
    var doc = pdfExport.ExportToPdf(this.dataGrid, pdfExportOption);

    StackedHeaderStyle

    Gets or sets the style to be applied for the exporting in the grid.

    Declaration
    public PdfGridCellStyle StackedHeaderStyle { get; set; }
    Property Value
    Type Description
    PdfGridCellStyle

    The style to be applied for the exporting StackedHeaderRows in the grid.

    Examples
    DataGridPdfExportingController pdfExport = new DataGridPdfExportingController();
    DataGridPdfExportOption pdfExportOption = new DataGridPdfExportOption();
    pdfExportOption.StackedHeaderStyle = new PdfGridCellStyle()
    {
        CellPadding = new PdfPaddings() { All = 5 }
    };
    var doc = pdfExport.ExportToPdf(this.dataGrid, pdfExportOption);

    StartPageIndex

    Gets or sets the starting page index of the pdf exporting.

    Declaration
    public int StartPageIndex { get; set; }
    Property Value
    Type Description
    System.Int32

    The starting page index.

    Remarks

    The start page index should be always less than pdf document page count.

    Examples
    DataGridPdfExportingController pdfExport = new DataGridPdfExportingController();
    DataGridPdfExportOption pdfExportOption = new DataGridPdfExportOption();
    pdfExportOption.StartIndex = 60;
    var doc = new PdfDocument();
    DataGridPdfExportOption pdfExportOption = new DataGridPdfExportOption() { PdfDocument = doc }; 
    pdfExport.ExportToPdf(this.dataGrid, pdfExportOption);

    StartPoint

    Gets or sets the starting point of the pdf exporting.

    Declaration
    public PointF StartPoint { get; set; }
    Property Value
    Type Description
    PointF

    The starting point .

    Examples
    DataGridPdfExportingController pdfExport = new DataGridPdfExportingController();
    DataGridPdfExportOption pdfExportOption = new DataGridPdfExportOption();
    pdfExportOption.StartPoint = new PointF(0,200);
    var doc = new PdfDocument();
    DataGridPdfExportOption pdfExportOption = new DataGridPdfExportOption() { PdfDocument = doc }; 
    pdfExport.ExportToPdf(this.dataGrid, pdfExportOption);

    TopTableSummaryStyle

    Gets or sets the style to be applied for the exporting top table summaries in the grid.

    Declaration
    public PdfGridCellStyle TopTableSummaryStyle { get; set; }
    Property Value
    Type Description
    PdfGridCellStyle

    The style to be applied for the exporting top table summaries in the grid.

    Examples
    DataGridPdfExportingController pdfExport = new DataGridPdfExportingController();
    DataGridPdfExportOption pdfExportOption = new DataGridPdfExportOption();
    pdfExportOption.TopTableSummaryStyle = new PdfGridCellStyle()
    {
        Borders = new PdfBorders() { All = new PdfPen(new PdfColor() { B = 5 }) }
    };
    var doc = pdfExport.ExportToPdf(this.dataGrid, pdfExportOption);

    UnboundRowStyle

    Gets or sets the style to be applied for the exporting UnboundRow in the grid.

    Declaration
    public PdfGridCellStyle UnboundRowStyle { get; set; }
    Property Value
    Type Description
    PdfGridCellStyle

    The style to be applied for the exporting UnboundRow in the grid.

    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved