WinForms

Code Examples Upgrade Guide User Guide Demos Support Forums Download
  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Enum PdfLightTableDataSourceType

    Show / Hide Table of Contents

    Enum PdfLightTableDataSourceType

    Specifies the data source type.

    Namespace: Syncfusion.Pdf.Tables
    Assembly: Syncfusion.Pdf.Base.dll
    Syntax
    public enum PdfLightTableDataSourceType
    Examples
    // Create a new document
    PdfDocument document = new PdfDocument();
    //Create DataTable for source
    DataTable dataTable = new DataTable("Table");
    dataTable.Columns.Add("ID1");
    dataTable.Columns[0].Caption = "id";
    dataTable.Columns.Add("ID2");
    object[] values = new object[] { "Table Features Demo", "" };
    dataTable.Rows.Add(values);
    //Create a new page
    PdfPage page = document.Pages.Add();
    //Create the PdfLightTable
    PdfLightTable table = new PdfLightTable();
    //Set the data source type
    table.DataSourceType = PdfLightTableDataSourceType.TableDirect;
    //Set the data table
    table.DataSource = dataTable; 
     Draw the table
    table.Draw(page.Graphics);
    //Save the document
    document.Save("Output.pdf");
    //Close the document
    document.Close(true);
    'Create a new document
    Dim document As PdfDocument = New PdfDocument()
    'Create DataTable for source
    Dim dataTable As DataTable = New DataTable("Table")
    dataTable.Columns.Add("ID1")
    dataTable.Columns(0).Caption = "id"
    dataTable.Columns.Add("ID2")
    Dim values() As Object = New Object() {"Table Features Demo", ""}
    dataTable.Rows.Add(values)
    'Create a page	
    Dim page As PdfPage = document.Pages.Add()
    'Create the PdfLightTable
    Dim table As PdfLightTable = New PdfLightTable()
    'Set the data source type
    table.DataSourceType = PdfLightTableDataSourceType.TableDirect
    'Set the data source
    table.DataSource = dataTable
    ' Draw the table
    table.Draw(page.Graphics)
    'Save the document
    document.Save("Output.pdf")
    'Close the document
    document.Close(True)

    Fields

    Name Description
    External

    Specifies that the PdfLightTable has been bind to an external data source.

    TableDirect

    Specifies that the values are directly bind to the PdfLightTable.

    See Also
    PdfDocument
    PdfColumn
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved