menu

WPF

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class PdfLightTableLayoutResult - WPF API Reference | Syncfusion

    Show / Hide Table of Contents

    Class PdfLightTableLayoutResult

    Represents the result of PdfLightTable which contains bounds and resultant page.

    Inheritance
    System.Object
    PdfLayoutResult
    PdfLightTableLayoutResult
    Inherited Members
    PdfLayoutResult.Bounds
    PdfLayoutResult.Page
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Syncfusion.Pdf.Tables
    Assembly: Syncfusion.Pdf.Base.dll
    Syntax
    public class PdfLightTableLayoutResult : PdfLayoutResult
    Examples
    // Create a new document
    PdfDocument doc = new PdfDocument();
    //Create a new page
    PdfPage page = doc.Pages.Add();
    // Create a new table
    PdfLightTable table = new PdfLightTable();
    // Set the DataSourceType as Direct
    table.DataSourceType = PdfLightTableDataSourceType.TableDirect;
    // Creating Columns
    table.Columns.Add(new PdfColumn("Roll Number"));
    table.Columns.Add(new PdfColumn("Name"));
    table.Columns.Add(new PdfColumn("Class"));
    // Adding rows
    PdfRowCollection rowCollection = table.Rows;
    // Gets the first row from the collection.
    rowCollection.Add(new object[] { "111", "Maxim", "III" });
    // Create the layout format
    PdfLightTableLayoutFormat format = new PdfLightTableLayoutFormat();
    format.Layout = PdfLayoutType.Paginate;
    format.Break = PdfLayoutBreakType.FitElement;
    // Draw the table
    PdfLightTableLayoutResult result = table.Draw(page, new PointF(0, 0), format);
    //Save the document.
    doc.Save("Output.pdf");
    //Close the document
    doc.Close(true);
    ' Create a new document
    Dim doc As New PdfDocument()
    'Create a new page
    Dim page As PdfPage = doc.Pages.Add()
    ' Create a new table
    Dim table As New PdfLightTable()
    ' Set the DataSourceType as Direct
    table.DataSourceType = PdfLightTableDataSourceType.TableDirect
    ' Creating Columns
    table.Columns.Add(New PdfColumn("Roll Number"))
    table.Columns.Add(New PdfColumn("Name"))
    table.Columns.Add(New PdfColumn("Class"))
    ' Adding rows
    Dim rowCollection As PdfRowCollection = table.Rows
    ' Gets the first row from the collection.
    rowCollection.Add(New Object() { "111", "Maxim", "III" })
    ' Create the layout format
    Dim format As New PdfLightTableLayoutFormat()
    format.Layout = PdfLayoutType.Paginate
    format.Break = PdfLayoutBreakType.FitElement
    ' Draw the table
    Dim result As PdfLightTableLayoutResult = table.Draw(page, New PointF(0, 0), format)
    'Save the document.
    doc.Save("Output.pdf")
    'Close the document
    doc.Close(True)

    Properties

    LastRowIndex

    Gets the index of the last row. Read-Only.

    Declaration
    public int LastRowIndex { get; }
    Property Value
    Type
    System.Int32
    Examples
    // Create a new document
    PdfDocument doc = new PdfDocument();
    //Create a new page
    PdfPage page = doc.Pages.Add();
    // Create a new table
    PdfLightTable table = new PdfLightTable();
    // Set the DataSourceType as Direct
    table.DataSourceType = PdfLightTableDataSourceType.TableDirect;
    // Creating Columns
    table.Columns.Add(new PdfColumn("Roll Number"));
    table.Columns.Add(new PdfColumn("Name"));
    table.Columns.Add(new PdfColumn("Class"));
    // Adding rows
    PdfRowCollection rowCollection = table.Rows;
    // Gets the first row from the collection.
    rowCollection.Add(new object[] { "111", "Maxim", "III" });
    // Create the layout format
    PdfLightTableLayoutFormat format = new PdfLightTableLayoutFormat();
    format.Layout = PdfLayoutType.Paginate;
    format.Break = PdfLayoutBreakType.FitElement;
    // Draw the table
    PdfLightTableLayoutResult result = table.Draw(page, new PointF(0, 0), format);
    // Gets the last row index
    int lastRow = result.LastRowIndex;
    //Save the document.
    doc.Save("Output.pdf");
    //Close the document
    doc.Close(true);
    ' Create a new document
    Dim doc As New PdfDocument()
    'Create a new page
    Dim page As PdfPage = doc.Pages.Add()
    ' Create a new table
    Dim table As New PdfLightTable()
    ' Set the DataSourceType as Direct
    table.DataSourceType = PdfLightTableDataSourceType.TableDirect
    ' Creating Columns
    table.Columns.Add(New PdfColumn("Roll Number"))
    table.Columns.Add(New PdfColumn("Name"))
    table.Columns.Add(New PdfColumn("Class"))
    ' Adding rows
    Dim rowCollection As PdfRowCollection = table.Rows
    ' Gets the first row from the collection.
    rowCollection.Add(New Object() { "111", "Maxim", "III" })
    ' Create the layout format
    Dim format As New PdfLightTableLayoutFormat()
    format.Layout = PdfLayoutType.Paginate
    format.Break = PdfLayoutBreakType.FitElement
    ' Draw the table
    Dim result As PdfLightTableLayoutResult = table.Draw(page, New PointF(0, 0), format)
    ' Gets the last row index
    Dim lastRow As Integer = result.LastRowIndex
    'Save the document.
    doc.Save("Output.pdf")
    'Close the document
    doc.Close(True)

    See Also

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