menu

Xamarin.Android

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class DataGridPdfExportOption - Xamarin.Android API Reference | Syncfusion

    Show / Hide Table of Contents

    Class DataGridPdfExportOption

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

    Inheritance
    System.Object
    DataGridPdfExportOption
    Namespace: Syncfusion.SfDataGrid.Exporting
    Assembly: Syncfusion.SfGridConverter.Android.dll
    Syntax
    public class DataGridPdfExportOption : Object

    Constructors

    DataGridPdfExportOption()

    Initializes a new instance of theDataGridPdfExportOption class.

    Declaration
    public DataGridPdfExportOption()

    Properties

    ApplyGridStyle

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

    Declaration
    public bool ApplyGridStyle { 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);

    AutoFitRowHeight

    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 heihght will be assigned based on ExportRowHeight.

    Declaration
    public bool AutoFitRowHeight { 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);

    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);

    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);

    ExportAllPages

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

    Declaration
    public bool ExportAllPages { 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);

    ExportColumnWidth

    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 ExportColumnWidth { 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);

    ExportGroups

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

    Declaration
    public bool ExportGroups { 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);

    ExportGroupSummary

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

    Declaration
    public bool ExportGroupSummary { 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);

    ExportHeader

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

    Declaration
    public bool ExportHeader { 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);

    ExportRowHeight

    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 ExportRowHeight { 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);

    ExportSwitchColumnAsFormFields

    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.

    Declaration
    public bool ExportSwitchColumnAsFormFields { 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);

    ExportTableSummary

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

    Declaration
    public bool ExportTableSummary { 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);

    ExportUnboundRows

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

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

    true if UnboundRows should be exported; otherwise, false.The default value is false.

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

    FitAllColumnsInOnePage

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

    Declaration
    public bool FitAllColumnsInOnePage { 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);

    GridColumns

    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<GridColumn> GridColumns { get; }
    Property Value
    Type Description
    System.Collections.Generic.IEnumerable<GridColumn>

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

    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);

    RepeatHeaders

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

    Declaration
    public bool RepeatHeaders { 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.

    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.

    See Also

    https://help.syncfusion.com/xamarin-android/sfdatagrid/exporting#exporting-options-1
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved