Class QueryNextRowEventArgs
Represents arguments of the NextRowEvent.
Inheritance
System.Object
System.EventArgs
QueryNextRowEventArgs
Inherited Members
System.EventArgs.Empty
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 QueryNextRowEventArgs : EventArgs
Examples
public string[][] datastring = new string[2][];
// Specify values for the table
datastring[0] = new string[] { "111", "Maxim", "100" };
datastring[1] = new string[] { "222", "Calvin", "95" };
// Create a new document
PdfDocument document = new PdfDocument();
//Create a Page
PdfPage page = document.Pages.Add();
//Create the PdfLightTable
PdfLightTable pdfLightTable = new PdfLightTable();
// Setting the DataSourceType as Direct
pdfLightTable.DataSourceType = PdfLightTableDataSourceType.External;
//Subscribing Events
pdfLightTable.QueryColumnCount += new QueryColumnCountEventHandler(table_QueryColumnCount);
pdfLightTable.QueryNextRow += new QueryNextRowEventHandler(table_QueryNextRow);
//Draw PdfLightTable.
pdfLightTable.Draw(page, new PointF(0, 0));
//Save the document.
document.Save("Output.pdf");
//Close the document
document.Close(true);
void table_QueryColumnCount(object sender, QueryColumnCountEventArgs args)
{
args.ColumnCount = 3;
}
void table_QueryNextRow(object sender, QueryNextRowEventArgs args)
{
if (datastring.Length > args.RowIndex)
args.RowData = new string[] { datastring[args.RowIndex][0], datastring[args.RowIndex][1], datastring[args.RowIndex][2] };
}
Public datastring(2)() As String
' Specify values for the table
datastring(0) = New String() { "111", "Maxim", "100" }
datastring(1) = New String() { "222", "Calvin", "95" }
' Create a new document' Create a new document
Dim document As New PdfDocument()
'Create a Page
Dim page As PdfPage = document.Pages.Add()
'Create the PdfLightTable
Dim pdfLightTable As New PdfLightTable()
' Setting the DataSourceType as Direct
pdfLightTable.DataSourceType = PdfLightTableDataSourceType.External
'Subscribing Events
AddHandler pdfLightTable.QueryColumnCount, AddressOf table_QueryColumnCount
AddHandler pdfLightTable.QueryNextRow, AddressOf table_QueryNextRow
'Draw PdfLightTable.
pdfLightTable.Draw(page, New PointF(0, 0))
'Save the document.
document.Save("Output.pdf")
'Close the document
document.Close(True)
Private Sub table_QueryColumnCount(ByVal sender As Object, ByVal args As QueryColumnCountEventArgs)
args.ColumnCount = 3
End Sub
Private Sub table_QueryNextRow(ByVal sender As Object, ByVal args As QueryNextRowEventArgs)
If datastring.Length > args.RowIndex Then
args.RowData = New String() { datastring(args.RowIndex)(0), datastring(args.RowIndex)(1), datastring(args.RowIndex)(2) }
End If
End Sub
Properties
ColumnCount
Gets the column count. Read-Only.
Declaration
public int ColumnCount { get; }
Property Value
Type |
---|
System.Int32 |
Examples
public string[][] datastring = new string[2][];
// Specify values for the table
datastring[0] = new string[] { "111", "Maxim", "100" };
datastring[1] = new string[] { "222", "Calvin", "95" };
// Create a new document
PdfDocument document = new PdfDocument();
//Create a Page
PdfPage page = document.Pages.Add();
//Create the PdfLightTable
PdfLightTable pdfLightTable = new PdfLightTable();
// Setting the DataSourceType as Direct
pdfLightTable.DataSourceType = PdfLightTableDataSourceType.External;
//Subscribing Events
pdfLightTable.QueryColumnCount += new QueryColumnCountEventHandler(table_QueryColumnCount);
pdfLightTable.QueryNextRow += new QueryNextRowEventHandler(table_QueryNextRow);
//Draw PdfLightTable.
pdfLightTable.Draw(page, new PointF(0, 0));
//Save the document.
document.Save("Output.pdf");
//Close the document
document.Close(true);
void table_QueryColumnCount(object sender, QueryColumnCountEventArgs args)
{
args.ColumnCount = 3;
}
void table_QueryNextRow(object sender, QueryNextRowEventArgs args)
{
if (datastring.Length > args.RowIndex)
args.RowData = new string[] { datastring[args.RowIndex][0], datastring[args.RowIndex][1], datastring[args.RowIndex][2] };
}
Public datastring(2)() As String
' Specify values for the table
datastring(0) = New String() { "111", "Maxim", "100" }
datastring(1) = New String() { "222", "Calvin", "95" }
' Create a new document' Create a new document
Dim document As New PdfDocument()
'Create a Page
Dim page As PdfPage = document.Pages.Add()
'Create the PdfLightTable
Dim pdfLightTable As New PdfLightTable()
' Setting the DataSourceType as Direct
pdfLightTable.DataSourceType = PdfLightTableDataSourceType.External
'Subscribing Events
AddHandler pdfLightTable.QueryColumnCount, AddressOf table_QueryColumnCount
AddHandler pdfLightTable.QueryNextRow, AddressOf table_QueryNextRow
'Draw PdfLightTable.
pdfLightTable.Draw(page, New PointF(0, 0))
'Save the document.
document.Save("Output.pdf")
'Close the document
document.Close(True)
Private Sub table_QueryColumnCount(ByVal sender As Object, ByVal args As QueryColumnCountEventArgs)
args.ColumnCount = 3
End Sub
Private Sub table_QueryNextRow(ByVal sender As Object, ByVal args As QueryNextRowEventArgs)
If datastring.Length > args.RowIndex Then
args.RowData = New String() { datastring(args.RowIndex)(0), datastring(args.RowIndex)(1), datastring(args.RowIndex)(2) }
End If
End Sub
RowData
Gets or sets the row data.
Declaration
public string[] RowData { get; set; }
Property Value
Type |
---|
System.String[] |
Examples
public string[][] datastring = new string[2][];
// Specify values for the table
datastring[0] = new string[] { "111", "Maxim", "100" };
datastring[1] = new string[] { "222", "Calvin", "95" };
// Create a new document
PdfDocument document = new PdfDocument();
//Create a Page
PdfPage page = document.Pages.Add();
//Create the PdfLightTable
PdfLightTable pdfLightTable = new PdfLightTable();
// Setting the DataSourceType as Direct
pdfLightTable.DataSourceType = PdfLightTableDataSourceType.External;
//Subscribing Events
pdfLightTable.QueryColumnCount += new QueryColumnCountEventHandler(table_QueryColumnCount);
pdfLightTable.QueryNextRow += new QueryNextRowEventHandler(table_QueryNextRow);
//Draw PdfLightTable.
pdfLightTable.Draw(page, new PointF(0, 0));
//Save the document.
document.Save("Output.pdf");
//Close the document
document.Close(true);
void table_QueryColumnCount(object sender, QueryColumnCountEventArgs args)
{
args.ColumnCount = 3;
}
void table_QueryNextRow(object sender, QueryNextRowEventArgs args)
{
if (datastring.Length > args.RowIndex)
args.RowData = new string[] { datastring[args.RowIndex][0], datastring[args.RowIndex][1], datastring[args.RowIndex][2] };
}
Public datastring(2)() As String
' Specify values for the table
datastring(0) = New String() { "111", "Maxim", "100" }
datastring(1) = New String() { "222", "Calvin", "95" }
' Create a new document' Create a new document
Dim document As New PdfDocument()
'Create a Page
Dim page As PdfPage = document.Pages.Add()
'Create the PdfLightTable
Dim pdfLightTable As New PdfLightTable()
' Setting the DataSourceType as Direct
pdfLightTable.DataSourceType = PdfLightTableDataSourceType.External
'Subscribing Events
AddHandler pdfLightTable.QueryColumnCount, AddressOf table_QueryColumnCount
AddHandler pdfLightTable.QueryNextRow, AddressOf table_QueryNextRow
'Draw PdfLightTable.
pdfLightTable.Draw(page, New PointF(0, 0))
'Save the document.
document.Save("Output.pdf")
'Close the document
document.Close(True)
Private Sub table_QueryColumnCount(ByVal sender As Object, ByVal args As QueryColumnCountEventArgs)
args.ColumnCount = 3
End Sub
Private Sub table_QueryNextRow(ByVal sender As Object, ByVal args As QueryNextRowEventArgs)
If datastring.Length > args.RowIndex Then
args.RowData = New String() { datastring(args.RowIndex)(0), datastring(args.RowIndex)(1), datastring(args.RowIndex)(2) }
End If
End Sub
RowIndex
Gets the index of the row. Read-Only.
Declaration
public int RowIndex { get; }
Property Value
Type |
---|
System.Int32 |
Examples
public string[][] datastring = new string[2][];
// Specify values for the table
datastring[0] = new string[] { "111", "Maxim", "100" };
datastring[1] = new string[] { "222", "Calvin", "95" };
// Create a new document
PdfDocument document = new PdfDocument();
//Create a Page
PdfPage page = document.Pages.Add();
//Create the PdfLightTable
PdfLightTable pdfLightTable = new PdfLightTable();
// Setting the DataSourceType as Direct
pdfLightTable.DataSourceType = PdfLightTableDataSourceType.External;
//Subscribing Events
pdfLightTable.QueryColumnCount += new QueryColumnCountEventHandler(table_QueryColumnCount);
pdfLightTable.QueryNextRow += new QueryNextRowEventHandler(table_QueryNextRow);
//Draw PdfLightTable.
pdfLightTable.Draw(page, new PointF(0, 0));
//Save the document.
document.Save("Output.pdf");
//Close the document
document.Close(true);
void table_QueryColumnCount(object sender, QueryColumnCountEventArgs args)
{
args.ColumnCount = 3;
}
void table_QueryNextRow(object sender, QueryNextRowEventArgs args)
{
if (datastring.Length > args.RowIndex)
args.RowData = new string[] { datastring[args.RowIndex][0], datastring[args.RowIndex][1], datastring[args.RowIndex][2] };
}
Public datastring(2)() As String
' Specify values for the table
datastring(0) = New String() { "111", "Maxim", "100" }
datastring(1) = New String() { "222", "Calvin", "95" }
' Create a new document' Create a new document
Dim document As New PdfDocument()
'Create a Page
Dim page As PdfPage = document.Pages.Add()
'Create the PdfLightTable
Dim pdfLightTable As New PdfLightTable()
' Setting the DataSourceType as Direct
pdfLightTable.DataSourceType = PdfLightTableDataSourceType.External
'Subscribing Events
AddHandler pdfLightTable.QueryColumnCount, AddressOf table_QueryColumnCount
AddHandler pdfLightTable.QueryNextRow, AddressOf table_QueryNextRow
'Draw PdfLightTable.
pdfLightTable.Draw(page, New PointF(0, 0))
'Save the document.
document.Save("Output.pdf")
'Close the document
document.Close(True)
Private Sub table_QueryColumnCount(ByVal sender As Object, ByVal args As QueryColumnCountEventArgs)
args.ColumnCount = 3
End Sub
Private Sub table_QueryNextRow(ByVal sender As Object, ByVal args As QueryNextRowEventArgs)
If datastring.Length > args.RowIndex Then
args.RowData = New String() { datastring(args.RowIndex)(0), datastring(args.RowIndex)(1), datastring(args.RowIndex)(2) }
End If
End Sub