Table of Contents

Enum PdfLightTableDataSourceType

Namespace
Syncfusion.Pdf.Tables
Assembly
Syncfusion.Pdf.Portable.dll

Specifies the data source type.

public enum PdfLightTableDataSourceType

Fields

External = 0

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

TableDirect = 1

Specifies that the values are directly bind to the PdfLightTable.

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)

See Also