cete.dynamicpdf.pageelements.cell2list
Cell2List
- Namespace: ceTe.DynamicPDF.PageElements
- Assemblies: DynamicPDF.NETFramework40.dll, DynamicPDF.NETStandard20.dll
Represents a list of cells.
public class Cell2List : IEnumerable
Public Class Cell2List
Implements IEnumerable
Inheritance: Object → Cell2List
Implements: IEnumerable
Licensing
This class is a DynamicPDF Generator Professional Edition feature. One of the following licenses is required for non-evaluation usage:
- DynamicPDF Generator for .NET Professional Edition
- DynamicPDF Generator for .NET Enterprise Edition
- DynamicPDF Merger for .NET Professional Edition
- DynamicPDF Merger for .NET Enterprise Edition
- DynamicPDF ReportWriter for .NET Professional Edition
- DynamicPDF ReportWriter for .NET Enterprise Edition
- DynamicPDF Core Suite for .NET Professional Edition
- DynamicPDF Core Suite for .NET Enterprise Edition
Properties
Count
Gets the number of elements actually contained in the Cell2 .
public int Count { get; }
Public Property Count As Int32
Property Value
Item[Int32]
Gets the Cell2 at the given index.
public Cell2 this[int index] { get; }
Public Property Item(index As Integer) As Cell2
Property Value
Methods
Add(PageElement)
Adds a Cell2 to the end of the Cell2List with the specified page element.
public Cell2 Add(PageElement element)
Function Add(element As PageElement) As Cell2
Parameters
- element: PageElement
Page element to be displayed in the cell.
Returns
Returns a Cell2 object.
Examples
The following example shows you how to build a simple table where some cells contain page elements.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Module MyModule
Sub Main()
' Create a PDF Document
Dim MyDocument As Document = New Document
Dim MyPage As Page = New Page
MyDocument.Pages.Add(MyPage)
Dim MyTable As Table2 = New Table2(0, 0, 600, 600)
MyTable.CellDefault.Align = TextAlign.Center
MyTable.CellDefault.VAlign = VAlign.Center
MyTable.Border.LineStyle = LineStyle.Solid
MyTable.CellSpacing = 5.0f
' Add columns to the table
MyTable.Columns.Add(150)
MyTable.Columns.Add(150)
MyTable.Columns.Add(150)
' Add rows to the table and add cells to the rows
Dim MyRow1 As Row2 = MyTable.Rows.Add(0, Font.HelveticaBold, 16, _
Grayscale.Black, Grayscale.LightGrey)
MyRow1.Cells.Add("Header 1")
MyRow1.Cells.Add("Header 2")
MyRow1.Cells.Add("Header 3")
Dim MyRow2 As Row2 = MyTable.Rows.Add()
MyRow2.Cells.Add("Formatted Text", Font.HelveticaBold, 16, Grayscale.Black, _
Grayscale.LightGrey, 1)
Dim formattedText As String = "<font face='Times'>Font Face, </font>" + _
"<font color='FF0000'>Color, </font><b>Bold.</b>"
MyRow2.Cells.Add(New FormattedTextArea(formattedText, 0, 0, 140, 15, _
FontFamily.Helvetica, 14, False))
MyRow2.Cells.Add("Item 1")
Dim MyRow3 As Row2 = MyTable.Rows.Add()
MyRow3.Cells.Add("Rowheader 1", Font.HelveticaBold, 16, Grayscale.Black, _
Grayscale.LightGrey, 1)
MyRow3.Cells.Add("Item 2")
MyRow3.Cells.Add("Item 3")
Dim MyRow4 As Row2 = MyTable.Rows.Add()
MyRow4.Cells.Add("Rowheader 2", Font.HelveticaBold, 16, Grayscale.Black, _
Grayscale.LightGrey, 1)
MyRow4.Cells.Add("Item 4")
MyRow4.Cells.Add("Item 5")
' Add the table to the page
MyPage.Elements.Add(MyTable)
' Save the PDF
MyDocument.Draw("C:\MyDocument.pdf")
End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
public class Example
{
public static void CreatePDF(string outputPath){ // Create a PDF Document Document document = new Document(); Page page = new Page(); document.Pages.Add( page ); Table2 table = new Table2(0, 0, 600, 600); table.CellDefault.Align = TextAlign.Center; table.CellDefault.VAlign = VAlign.Center;
table.Border.LineStyle = LineStyle.Solid;
table.CellSpacing = 5.0f; // Add columns to the table table.Columns.Add( 150 ); table.Columns.Add( 150 ); table.Columns.Add( 150 ); // Add rows to the table and add cells to the rows Row2 row1 = table.Rows.Add( 0, Font.HelveticaBold, 16, Grayscale.Black, Grayscale.LightGrey ); row1.Cells.Add( "Header 1" ); row1.Cells.Add( "Header 2" ); row1.Cells.Add( "Header 3" ); Row2 row2 = table.Rows.Add( 30 ); row2.Cells.Add( "Formatted Text", Font.HelveticaBold, 16, Grayscale.Black, Grayscale.LightGrey, 1 ); string formattedText = "<font face='Times'>Font Face, </font>" + "<font color='FF0000'>Color, </font><b>Bold.</b>"; row2.Cells.Add( new FormattedTextArea( formattedText, 0, 0, 140, 15, FontFamily.Helvetica, 14, false ) ); row2.Cells.Add( "Item 1" ); Row2 row3 = table.Rows.Add(); row3.Cells.Add( "Rowheader 1", Font.HelveticaBold, 16, Grayscale.Black, Grayscale.LightGrey, 1 ); row3.Cells.Add( "Item 2" ); row3.Cells.Add( "Item 3" ); Row2 row4 = table.Rows.Add(); row4.Cells.Add( "Rowheader 2", Font.HelveticaBold, 16, Grayscale.Black, Grayscale.LightGrey, 1 ); row4.Cells.Add( "Item 4" ); row4.Cells.Add( "Item 5" ); // Add the table to the page page.Elements.Add( table ); // Save the PDF document.Draw( outputPath );}
}
Remarks
This method is used to add any page element to the table. Note that a page element should only be added to the cell directly if that page element impliments IArea . If the page element does not impliment IArea then it is recommended you place your page element(s) in an AreaGroup . This will assuree that the row will adjust to the height of the page element as needed.
Add(PageElement, Int32)
Adds a Cell2 to the end of the Cell2List with the specified page element.
public Cell2 Add(PageElement element, int colSpan)
Function Add(element As PageElement, colSpan As Integer) As Cell2
Parameters
- element: PageElement
Page element to be displayed in the cell.
- colSpan: Int32
Number of columns that the cell will span.
Returns
Returns a Cell2 object.
Examples
The following example shows you how to build a simple table.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Module MyModule
Sub Main()
' Create a PDF Document
Dim MyDocument As Document = New Document
Dim MyPage As Page = New Page
MyDocument.Pages.Add(MyPage)
Dim MyTable As Table2 = New Table2(0, 0, 600, 600)
MyTable.CellDefault.Align = TextAlign.Center
MyTable.CellDefault.VAlign = VAlign.Center
MyTable.Border.LineStyle = LineStyle.Solid
MyTable.CellSpacing = 5.0f
' Add columns to the table
MyTable.Columns.Add(150)
MyTable.Columns.Add(150)
MyTable.Columns.Add(150)
' Add rows to the table and add cells to the rows
Dim MyRow1 As Row2 = MyTable.Rows.Add(0, Font.HelveticaBold, 16, _
Grayscale.Black, Grayscale.LightGrey)
MyRow1.Cells.Add("Header 1")
MyRow1.Cells.Add("Header 2")
MyRow1.Cells.Add("Header 3")
Dim MyRow8 As Row2 = MyTable.Rows.Add()
MyRow8.Cells.Add("Lines", Font.HelveticaBold, 16, Grayscale.Black, _
Grayscale.LightGrey, 1)
Dim lineGroup As AreaGroup = New AreaGroup(150, 150)
lineGroup.Add(New Line(25, 25, 125, 125, 5))
lineGroup.Add(New Line(25, 125, 125, 25, 5))
MyRow8.Cells.Add(lineGroup, 2)
Dim MyRow3 As Row2 = MyTable.Rows.Add()
MyRow3.Cells.Add("Rowheader 1", Font.HelveticaBold, 16, Grayscale.Black, _
Grayscale.LightGrey, 1)
MyRow3.Cells.Add("Item 1")
MyRow3.Cells.Add("Item 2")
Dim MyRow4 As Row2 = MyTable.Rows.Add()
MyRow4.Cells.Add("Rowheader 2", Font.HelveticaBold, 16, Grayscale.Black, _
Grayscale.LightGrey, 1)
MyRow4.Cells.Add("Item 3")
MyRow4.Cells.Add("Item 4")
' Add the table to the page
MyPage.Elements.Add(MyTable)
' Save the PDF
MyDocument.Draw("C:\MyDocument.pdf")
End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
public class Example
{
public static void CreatePDF(string outputPath)
{
// Create a PDF Document
Document document = new Document();
Page page = new Page();
document.Pages.Add(page);
Table2 table = new Table2(0, 0, 600, 600);
table.CellDefault.Align = TextAlign.Center;
table.CellDefault.VAlign = VAlign.Center;
table.Border.LineStyle = LineStyle.Solid;
table.CellSpacing = 5.0f;
// Add columns to the table
table.Columns.Add(150);
table.Columns.Add(150);
table.Columns.Add(150);
// Add rows to the table and add cells to the rows
Row2 row1 = table.Rows.Add(0, Font.HelveticaBold, 16, Grayscale.Black,
Grayscale.LightGrey);
row1.Cells.Add("Header 1");
row1.Cells.Add("Header 2");
row1.Cells.Add("Header 3");
Row2 row2 = table.Rows.Add(30);
row2.Cells.Add("Lines", Font.HelveticaBold, 16, Grayscale.Black,
Grayscale.LightGrey, 1);
AreaGroup lineGroup = new AreaGroup(150, 150);
lineGroup.Add(new Line(25, 25, 125, 125, 5));
lineGroup.Add(new Line(25, 125, 125, 25, 5));
row2.Cells.Add(lineGroup, 2);
Row2 row3 = table.Rows.Add();
row3.Cells.Add("Rowheader 1", Font.HelveticaBold, 16, Grayscale.Black,
Grayscale.LightGrey, 1);
row3.Cells.Add("Item 1");
row3.Cells.Add("Item 2");
Row2 row4 = table.Rows.Add();
row4.Cells.Add("Rowheader 2", Font.HelveticaBold, 16, Grayscale.Black,
Grayscale.LightGrey, 1);
row4.Cells.Add("Item 3");
row4.Cells.Add("Item 4");
// Add the table to the page
page.Elements.Add(table);
// Save the PDF
document.Draw(outputPath);
}
}
Remarks
This method is used to add any page element to the table. Note that a page element should only be added to the cell directly if that page element impliments IArea . If the page element does not impliment IArea then it is recommended you place your page element(s) in an AreaGroup . This will assuree that the row will adjust to the height of the page element as needed.
Add(PageElement, Int32, Int32)
Adds a Cell2 to the end of the Cell2List with the specified page element.
public Cell2 Add(PageElement element, int colSpan, int rowSpan)
Function Add(element As PageElement, colSpan As Integer, rowSpan As Integer) As Cell2
Parameters
- element: PageElement
Page element to be displayed in the cell.
- colSpan: Int32
Number of columns that the cell will span.
- rowSpan: Int32
Number of rows that the cell will span.
Returns
Returns a Cell2 object.
Examples
The following example shows you how to build a simple table.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Module MyModule
Sub Main()
' Create a PDF Document
Dim MyDocument As Document = New Document
Dim MyPage As Page = New Page
MyDocument.Pages.Add(MyPage)
Dim MyTable As Table2 = New Table2(0, 0, 600, 600)
MyTable.CellDefault.Align = TextAlign.Center
MyTable.CellDefault.VAlign = VAlign.Center
MyTable.Border.LineStyle = LineStyle.Solid
MyTable.CellSpacing = 5.0f
' Add columns to the table
MyTable.Columns.Add(150)
MyTable.Columns.Add(150)
MyTable.Columns.Add(150)
' Add rows to the table and add cells to the rows
Dim MyRow1 As Row2 = MyTable.Rows.Add(0, Font.HelveticaBold, 16, _
Grayscale.Black, Grayscale.LightGrey)
MyRow1.Cells.Add("Header 1")
MyRow1.Cells.Add("Header 2")
MyRow1.Cells.Add("Header 3")
Dim MyRow2 As Row2 = MyTable.Rows.Add()
MyRow2.Cells.Add("Rectangle", Font.HelveticaBold, 16, Grayscale.Black, _
Grayscale.LightGrey, 1)
Dim rect As Rectangle = New Rectangle(0, 0, 90, 90, RgbColor.YellowGreen, _
RgbColor.Blue, 2)
MyRow2.Cells.Add(rect, 2, 2)
Dim MyRow3 As Row2 = MyTable.Rows.Add()
MyRow3.Cells.Add("Rectangle", Font.HelveticaBold, 16, Grayscale.Black, _
Grayscale.LightGrey, 1)
Dim MyRow4 As Row2 = MyTable.Rows.Add()
MyRow4.Cells.Add("Rowheader 1", Font.HelveticaBold, 16, Grayscale.Black, _
Grayscale.LightGrey, 1)
MyRow4.Cells.Add("Item 1")
MyRow4.Cells.Add("Item 2")
' Add the table to the page
MyPage.Elements.Add(MyTable)
' Save the PDF
MyDocument.Draw("C:\MyDocument.pdf")
End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
public class Example
{
public static void CreatePDF(string outputPath)
{
// Create a PDF Document
Document document = new Document();
Page page = new Page();
document.Pages.Add(page);
Table2 table = new Table2(0, 0, 600, 600);
table.CellDefault.Align = TextAlign.Center;
table.CellDefault.VAlign = VAlign.Center;
table.Border.LineStyle = LineStyle.Solid;
table.CellSpacing = 5.0f;
// Add columns to the table
table.Columns.Add(150);
table.Columns.Add(150);
table.Columns.Add(150);
// Add rows to the table and add cells to the rows
Row2 row1 = table.Rows.Add(0, Font.HelveticaBold, 16, Grayscale.Black,
Grayscale.LightGrey);
row1.Cells.Add("Header 1");
row1.Cells.Add("Header 2");
row1.Cells.Add("Header 3");
Row2 row2 = table.Rows.Add();
row2.Cells.Add("Rectangle", Font.HelveticaBold, 16, Grayscale.Black,
Grayscale.LightGrey, 1);
Rectangle rect = new Rectangle(0, 0, 90, 90, RgbColor.YellowGreen,
RgbColor.Blue, 2);
row2.Cells.Add(rect, 2, 2);
Row2 row3 = table.Rows.Add();
row3.Cells.Add("Rectangle", Font.HelveticaBold, 16, Grayscale.Black,
Grayscale.LightGrey, 1);
Row2 row4 = table.Rows.Add();
row4.Cells.Add("Rowheader 1", Font.HelveticaBold, 16, Grayscale.Black,
Grayscale.LightGrey, 1);
row4.Cells.Add("Item 1");
row4.Cells.Add("Item 2");
// Add the table to the page
page.Elements.Add(table);
// Save the PDF
document.Draw(outputPath);
}
}
Remarks
This method is used to add any page element to the table. Note that a page element should only be added to the cell directly if that page element impliments IArea . If the page element does not impliment IArea then it is recommended you place your page element(s) in an AreaGroup . This will assuree that the row will adjust to the height of the page element as needed.
Add(String)
Adds a Cell2 to the end of the Cell2List .
public Cell2 Add(string text)
Function Add(text As String) As Cell2
Parameters
- text: String
Text to be displayed in the cell.
Returns
Returns a Cell2 object.
Examples
The following example shows you how to build a simple table.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Module MyModule
Sub Main()
' Create a PDF Document
Dim MyDocument As Document = New Document
Dim MyPage As Page = New Page
MyDocument.Pages.Add(MyPage)
Dim MyTable As Table2 = New Table2(0, 0, 600, 600)
MyTable.CellDefault.Align = TextAlign.Center
MyTable.CellDefault.VAlign = VAlign.Center
MyTable.Border.LineStyle = LineStyle.Solid
MyTable.CellSpacing = 5.0f
' Add columns to the table
MyTable.Columns.Add(150)
MyTable.Columns.Add(150)
MyTable.Columns.Add(150)
' Add rows to the table and add cells to the rows
Dim MyRow1 As Row2 = MyTable.Rows.Add(0, Font.HelveticaBold, 16, Grayscale.Black, _
Grayscale.LightGrey)
MyRow1.Cells.Add("Header 1")
MyRow1.Cells.Add("Header 2")
MyRow1.Cells.Add("Header 3")
Dim MyRow2 As Row2 = MyTable.Rows.Add()
MyRow2.Cells.Add("Rowheader 1", Font.HelveticaBold, 16, Grayscale.Black, _
Grayscale.LightGrey, 1)
MyRow2.Cells.Add("Item 1")
MyRow2.Cells.Add("Item 2")
Dim MyRow3 As Row2 = MyTable.Rows.Add()
MyRow3.Cells.Add("Rowheader 2", Font.HelveticaBold, 16, Grayscale.Black, _
Grayscale.LightGrey, 1)
MyRow3.Cells.Add("Item 3")
MyRow3.Cells.Add("Item 4")
Dim MyRow4 As Row2 = MyTable.Rows.Add()
MyRow4.Cells.Add("Rowheader 3", Font.HelveticaBold, 16, Grayscale.Black, _
Grayscale.LightGrey, 1)
MyRow4.Cells.Add("Item 5")
MyRow4.Cells.Add("Item 6")
' Add the table to the page
MyPage.Elements.Add(MyTable)
' Save the PDF
MyDocument.Draw("C:\MyDocument.pdf")
End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
public class Example
{
public static void CreatePDF(string outputPath)
{
// Create a PDF Document
Document document = new Document();
Page page = new Page();
document.Pages.Add(page);
Table2 table = new Table2(0, 0, 600, 800);
table.CellDefault.Align = TextAlign.Center;
table.CellDefault.VAlign = VAlign.Center;
table.Border.LineStyle = LineStyle.Solid;
table.CellSpacing = 5.0f;
// Add columns to the table
table.Columns.Add(150);
table.Columns.Add(150);
table.Columns.Add(150);
// Add rows to the table and add cells to the rows
Row2 row1 = table.Rows.Add(0, Font.HelveticaBold, 16, Grayscale.Black,
Grayscale.LightGrey);
row1.Cells.Add("Header 1");
row1.Cells.Add("Header 2");
row1.Cells.Add("Header 3");
Row2 row2 = table.Rows.Add();
row2.Cells.Add("Rowheader 1", Font.HelveticaBold, 16, Grayscale.Black,
Grayscale.LightGrey, 1);
row2.Cells.Add("Item 1");
row2.Cells.Add("Item 2");
Row2 row3 = table.Rows.Add();
row3.Cells.Add("Rowheader 2", Font.HelveticaBold, 16, Grayscale.Black,
Grayscale.LightGrey, 1);
row3.Cells.Add("Item 3");
row3.Cells.Add("Item 4");
Row2 row4 = table.Rows.Add();
row4.Cells.Add("Rowheader 3", Font.HelveticaBold, 16, Grayscale.Black,
Grayscale.LightGrey, 1);
row4.Cells.Add("Item 5");
row4.Cells.Add("Item 6");
// Add the table to the page
page.Elements.Add(table);
// Save the PDF
document.Draw(outputPath);
}
}
Remarks
This method is used to add any text to a cell in a table.
Add(String, Font, Single?)
Adds a Cell2 to the end of the Cell2List .
public Cell2 Add(string text, Font font, float? fontSize)
Function Add(text As String, font As Font, fontSize As Single?) As Cell2
Parameters
- text: String
Text to be displayed in the cell.
- font: Font
Font for the text in the cell.
- fontSize: Single?
Font size for the text in the cell.
Returns
Returns a Cell2 object.
Examples
The following example shows you how to build a simple table.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Module MyModule
Sub Main()
' Create a PDF Document
Dim MyDocument As Document = New Document
Dim MyPage As Page = New Page
MyDocument.Pages.Add(MyPage)
Dim MyTable As Table2 = New Table2(0, 0, 600, 600)
MyTable.CellDefault.Align = TextAlign.Center
MyTable.CellDefault.VAlign = VAlign.Center
MyTable.Border.LineStyle = LineStyle.Solid
MyTable.CellSpacing = 5.0f
' Add columns to the table
MyTable.Columns.Add(150)
MyTable.Columns.Add(150)
MyTable.Columns.Add(150)
' Add rows to the table and add cells to the rows
Dim MyRow1 As Row2 = MyTable.Rows.Add(0, Font.HelveticaBold, 16, Grayscale.Black, _
Grayscale.LightGrey)
MyRow1.Cells.Add("Header 1")
MyRow1.Cells.Add("Header 2")
MyRow1.Cells.Add("Header 3")
Dim MyRow2 As Row2 = MyTable.Rows.Add()
MyRow2.Cells.Add("Rowheader 1", Font.HelveticaBold, 16, Grayscale.Black, _
Grayscale.LightGrey, 1)
MyRow2.Cells.Add("Item 1")
MyRow2.Cells.Add("Item 2")
Dim MyRow3 As Row2 = MyTable.Rows.Add()
MyRow3.Cells.Add("Rowheader 2", Font.HelveticaBold, 16, Grayscale.Black, _
Grayscale.LightGrey, 1)
MyRow3.Cells.Add("Item 3")
MyRow3.Cells.Add("Item 4")
Dim MyRow4 As Row2 = MyTable.Rows.Add()
MyRow4.Cells.Add("Rowheader 3", Font.HelveticaBold, 16, Grayscale.Black, _
Grayscale.LightGrey, 1)
MyRow4.Cells.Add("Item 5", Font.Courier, 10)
MyRow4.Cells.Add("Item 6", Font.Courier, 10)
' Add the table to the page
MyPage.Elements.Add(MyTable)
' Save the PDF
MyDocument.Draw("C:\MyDocument.pdf")
End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
public class Example
{
public static void CreatePDF(string outputPath)
{
// Create a PDF Document
Document document = new Document();
Page page = new Page();
document.Pages.Add( page );
Table2 table = new Table2(0, 0, 600, 600);
table.CellDefault.Align = TextAlign.Center;
table.CellDefault.VAlign = VAlign.Center;
table.Border.LineStyle = LineStyle.Solid;
table.CellSpacing = 5.0f;
// Add columns to the table
table.Columns.Add( 150 );
table.Columns.Add( 150 );
table.Columns.Add( 150 );
// Add rows to the table and add cells to the rows
Row2 row1 = table.Rows.Add( 0, Font.HelveticaBold, 16, Grayscale.Black,
Grayscale.LightGrey );
row1.Cells.Add( "Header 1" );
row1.Cells.Add( "Header 2" );
row1.Cells.Add( "Header 3" );
Row2 row2 = table.Rows.Add();
row2.Cells.Add( "Rowheader 1", Font.HelveticaBold, 16, Grayscale.Black,
Grayscale.LightGrey, 1 );
row2.Cells.Add( "Item 1" );
row2.Cells.Add( "Item 2" );
Row2 row3 = table.Rows.Add();
row3.Cells.Add( "Rowheader 2", Font.HelveticaBold, 16, Grayscale.Black,
Grayscale.LightGrey, 1 );
row3.Cells.Add( "Item 3" );
row3.Cells.Add( "Item 4" );
Row2 row4 = table.Rows.Add();
row4.Cells.Add( "Rowheader 3", Font.HelveticaBold, 16, Grayscale.Black,
Grayscale.LightGrey, 1 );
row4.Cells.Add( "Item 5", Font.Courier, 10 );
row4.Cells.Add( "Item 6", Font.Courier, 10 );
// Add the table to the page
page.Elements.Add( table );
// Save the PDF
document.Draw(outputPath);
}
}
Remarks
This method is used to add any text to a cell in a table.
Add(String, Font, Single?, Color, Color, Int32)
Adds a Cell2 to the end of the Cell2List .
public Cell2 Add(string text, Font font, float? fontSize, Color textColor, Color backColor, int colSpan)
Function Add(text As String, font As Font, fontSize As Single?, textColor As Color, backColor As Color, colSpan As Integer) As Cell2
Parameters
- text: String
Text to be displayed in the cell.
- font: Font
Font for the text in the cell.
- fontSize: Single?
Font size for the text in the cell.
- textColor: Color
Color for the text in the cell.
- backColor: Color
Background color for the cell.
- colSpan: Int32
Number of columns that the cell will span.
Returns
Returns a Cell2 object.
Examples
The following example shows you how to build a simple table.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Module MyModule
Sub Main()
' Create a PDF Document
Dim MyDocument As Document = New Document
Dim MyPage As Page = New Page
MyDocument.Pages.Add(MyPage)
Dim MyTable As Table2 = New Table2(0, 0, 600, 600)
MyTable.CellDefault.Align = TextAlign.Center
MyTable.CellDefault.VAlign = VAlign.Center
MyTable.Border.LineStyle = LineStyle.Solid
MyTable.CellSpacing = 5.0f
' Add columns to the table
MyTable.Columns.Add(150)
MyTable.Columns.Add(150)
MyTable.Columns.Add(150)
' Add rows to the table and add cells to the rows
Dim MyRow1 As Row2 = MyTable.Rows.Add(0, Font.HelveticaBold, 16, _
Grayscale.Black, Grayscale.LightGrey)
MyRow1.Cells.Add("Header 1")
MyRow1.Cells.Add("Header 2")
MyRow1.Cells.Add("Header 3")
Dim MyRow2 As Row2 = MyTable.Rows.Add()
MyRow2.Cells.Add("Rowheader 1", Font.HelveticaBold, 16, Grayscale.Black, _
Grayscale.LightGrey, 1)
MyRow2.Cells.Add("Item 1", Font.HelveticaOblique, 14, RgbColor.Blue, _
RgbColor.Yellow, 2)
Dim MyRow3 As Row2 = MyTable.Rows.Add()
MyRow3.Cells.Add("Rowheader 2", Font.HelveticaBold, 16, Grayscale.Black, _
Grayscale.LightGrey, 1)
MyRow3.Cells.Add("Item 2")
MyRow3.Cells.Add("Item 3")
Dim MyRow4 As Row2 = MyTable.Rows.Add()
MyRow4.Cells.Add("Rowheader 3", Font.HelveticaBold, 16, Grayscale.Black, _
Grayscale.LightGrey, 1)
MyRow4.Cells.Add("Item 4")
MyRow4.Cells.Add("Item 5")
' Add the table to the page
MyPage.Elements.Add(MyTable)
' Save the PDF
MyDocument.Draw("C:\MyDocument.pdf")
End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
public class Example
{
public static void CreatePDF(string outputPath)
{
// Create a PDF Document
Document document = new Document();
Page page = new Page();
document.Pages.Add(page);
Table2 table = new Table2(0, 0, 600, 600);
table.CellDefault.Align = TextAlign.Center;
table.CellDefault.VAlign = VAlign.Center;
table.Border.LineStyle = LineStyle.Solid;
table.CellSpacing = 5.0f;
// Add columns to the table
table.Columns.Add(150);
table.Columns.Add(150);
table.Columns.Add(150);
// Add rows to the table and add cells to the rows
Row2 row1 = table.Rows.Add(0, Font.HelveticaBold, 16, Grayscale.Black,
Grayscale.LightGrey);
row1.Cells.Add("Header 1");
row1.Cells.Add("Header 2");
row1.Cells.Add("Header 3");
Row2 row2 = table.Rows.Add();
row2.Cells.Add("Rowheader 1", Font.HelveticaBold, 16, Grayscale.Black,
Grayscale.LightGrey, 1);
row2.Cells.Add("Item 1", Font.HelveticaOblique, 14, RgbColor.Blue,
RgbColor.Yellow, 2);
Row2 row3 = table.Rows.Add();
row3.Cells.Add("Rowheader 2", Font.HelveticaBold, 16, Grayscale.Black,
Grayscale.LightGrey, 1);
row3.Cells.Add("Item 2");
row3.Cells.Add("Item 3");
Row2 row4 = table.Rows.Add();
row4.Cells.Add("Rowheader 3", Font.HelveticaBold, 16, Grayscale.Black,
Grayscale.LightGrey, 1);
row4.Cells.Add("Item 4");
row4.Cells.Add("Item 5");
// Add the table to the page
page.Elements.Add(table);
// Save the PDF
document.Draw(outputPath);
}
}
Remarks
This method is used to add any text to a cell in a table.
Add(String, Font, Single?, Color, Color, Int32, Int32)
Adds a Cell2 to the end of the Cell2List .
public Cell2 Add(string text, Font font, float? fontSize, Color textColor, Color backColor, int colSpan, int rowSpan)
Function Add(text As String, font As Font, fontSize As Single?, textColor As Color, backColor As Color, colSpan As Integer, rowSpan As Integer) As Cell2
Parameters
- text: String
Text to be displayed in the cell.
- font: Font
Font for the text in the cell.
- fontSize: Single?
Font size for the text in the cell.
- textColor: Color
Color for the text in the cell.
- backColor: Color
Background color for the cell.
- colSpan: Int32
Number of columns that the cell will span.
- rowSpan: Int32
Number of rows that the cell will span.
Returns
Returns a Cell2 object.
Examples
The following example shows you how to build a simple table.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Module MyModule
Sub Main()
' Create a PDF Document
Dim MyDocument As Document = New Document
Dim MyPage As Page = New Page
MyDocument.Pages.Add(MyPage)
Dim MyTable As Table2 = New Table2(0, 0, 600, 600)
MyTable.CellDefault.Align = TextAlign.Center
MyTable.CellDefault.VAlign = VAlign.Center
MyTable.Border.LineStyle = LineStyle.Solid
MyTable.CellSpacing = 5.0f
' Add columns to the table
MyTable.Columns.Add(150)
MyTable.Columns.Add(150)
MyTable.Columns.Add(150)
' Add rows to the table and add cells to the rows
Dim MyRow1 As Row2 = MyTable.Rows.Add(0, Font.HelveticaBold, 16, _
Grayscale.Black, Grayscale.LightGrey)
MyRow1.Cells.Add("Header 1")
MyRow1.Cells.Add("Header 2")
MyRow1.Cells.Add("Header 3")
Dim MyRow2 As Row2 = MyTable.Rows.Add()
MyRow2.Cells.Add("Rowheader 1", Font.HelveticaBold, 16, Grayscale.Black, _
Grayscale.LightGrey, 1)
MyRow2.Cells.Add("Item 1", Font.HelveticaOblique, 16, RgbColor.Red, _
RgbColor.LightSkyBlue, 2, 2)
Dim MyRow3 As Row2 = MyTable.Rows.Add()
MyRow3.Cells.Add("Rowheader 2", Font.HelveticaBold, 16, Grayscale.Black, _
Grayscale.LightGrey, 1)
Dim MyRow4 As Row2 = MyTable.Rows.Add()
MyRow4.Cells.Add("Rowheader 3", Font.HelveticaBold, 16, Grayscale.Black, _
Grayscale.LightGrey, 1)
MyRow4.Cells.Add("Item 2")
MyRow4.Cells.Add("Item 3")
' Add the table to the page
MyPage.Elements.Add(MyTable)
' Save the PDF
MyDocument.Draw("C:\MyDocument.pdf")
End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
public class Example
{
public static void CreatePDF(string outputPath)
{
// Create a PDF Document
Document document = new Document();
Page page = new Page();
document.Pages.Add(page);
Table2 table = new Table2(0, 0, 600, 600);
table.CellDefault.Align = TextAlign.Center;
table.CellDefault.VAlign = VAlign.Center;
table.Border.LineStyle = LineStyle.Solid;
table.CellSpacing = 5.0f;
// Add columns to the table
table.Columns.Add(150);
table.Columns.Add(150);
table.Columns.Add(150);
// Add rows to the table and add cells to the rows
Row2 row1 = table.Rows.Add(0, Font.HelveticaBold, 16, Grayscale.Black,
Grayscale.LightGrey);
row1.Cells.Add("Header 1");
row1.Cells.Add("Header 2");
row1.Cells.Add("Header 3");
Row2 row2 = table.Rows.Add();
row2.Cells.Add("Rowheader 1", Font.HelveticaBold, 16, Grayscale.Black,
Grayscale.LightGrey, 1);
row2.Cells.Add("Item 1", Font.HelveticaOblique, 14, RgbColor.Red,
RgbColor.LightSkyBlue, 2, 2);
Row2 row3 = table.Rows.Add();
row3.Cells.Add("Rowheader 2", Font.HelveticaBold, 16, Grayscale.Black,
Grayscale.LightGrey, 1);
Row2 row4 = table.Rows.Add();
row4.Cells.Add("Rowheader 3", Font.HelveticaBold, 16, Grayscale.Black,
Grayscale.LightGrey, 1);
row4.Cells.Add("Item 2");
row4.Cells.Add("Item 3");
// Add the table to the page
page.Elements.Add(table);
// Save the PDF
document.Draw(outputPath);
}
}
Remarks
This method is used to add any text to a cell in a table.
Add(String, Font, Single?, Int32)
Adds a Cell2 to the end of the Cell2List .
public Cell2 Add(string text, Font font, float? fontSize, int colSpan)
Function Add(text As String, font As Font, fontSize As Single?, colSpan As Integer) As Cell2
Parameters
- text: String
Text to be displayed in the cell.
- font: Font
Font for the text in the cell.
- fontSize: Single?
Font size for the text in the cell.
- colSpan: Int32
Number of columns that the cell will span.
Returns
Returns a Cell2 object.
Examples
The following example shows you how to build a simple table.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Module MyModule
Sub Main()
' Create a PDF Document
Dim MyDocument As Document = New Document
Dim MyPage As Page = New Page
MyDocument.Pages.Add(MyPage)
Dim MyTable As Table2 = New Table2(0, 0, 600, 600)
MyTable.CellDefault.Align = TextAlign.Center
MyTable.CellDefault.VAlign = VAlign.Center
MyTable.Border.LineStyle = LineStyle.Solid
MyTable.CellSpacing = 5.0f
' Add columns to the table
MyTable.Columns.Add(150)
MyTable.Columns.Add(150)
MyTable.Columns.Add(150)
' Add rows to the table and add cells to the rows
Dim MyRow1 As Row2 = MyTable.Rows.Add(0, Font.HelveticaBold, 16, _
Grayscale.Black, Grayscale.LightGrey)
MyRow1.Cells.Add("Header 1")
MyRow1.Cells.Add("Header 2")
MyRow1.Cells.Add("Header 3")
Dim MyRow2 As Row2 = MyTable.Rows.Add()
MyRow2.Cells.Add("Rowheader 1", Font.HelveticaBold, 16, Grayscale.Black, _
Grayscale.LightGrey, 1)
MyRow2.Cells.Add("Item 1", Font.HelveticaOblique, 14, 2)
Dim MyRow3 As Row2 = MyTable.Rows.Add()
MyRow3.Cells.Add("Rowheader 2", Font.HelveticaBold, 16, Grayscale.Black, _
Grayscale.LightGrey, 1)
MyRow3.Cells.Add("Item 2")
MyRow3.Cells.Add("Item 3")
Dim MyRow4 As Row2 = MyTable.Rows.Add()
MyRow4.Cells.Add("Rowheader 3", Font.HelveticaBold, 16, Grayscale.Black, _
Grayscale.LightGrey, 1)
MyRow4.Cells.Add("Item 4")
MyRow4.Cells.Add("Item 5")
' Add the table to the page
MyPage.Elements.Add(MyTable)
' Save the PDF
MyDocument.Draw("C:\MyDocument.pdf")
End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
public class Example
{
public static void CreatePDF(string outputPath)
{
//Create a PDF Document
Document document = new Document();
Page page = new Page();
document.Pages.Add(page);
Table2 table = new Table2(0, 0, 600, 600);
table.CellDefault.Align = TextAlign.Center;
table.CellDefault.VAlign = VAlign.Center;
table.Border.LineStyle = LineStyle.Solid;
table.CellSpacing = 5.0f;
// Add columns to the table
table.Columns.Add(150);
table.Columns.Add(150);
table.Columns.Add(150);
// Add rows to the table and add cells to the rows
Row2 row1 = table.Rows.Add(0, Font.HelveticaBold, 16, Grayscale.Black,
Grayscale.LightGrey);
row1.Cells.Add("Header 1");
row1.Cells.Add("Header 2");
row1.Cells.Add("Header 3");
Row2 row2 = table.Rows.Add();
row2.Cells.Add("Rowheader 1", Font.HelveticaBold, 16, Grayscale.Black,
Grayscale.LightGrey, 1);
row2.Cells.Add("Item 1", Font.HelveticaOblique, 14, 2);
Row2 row3 = table.Rows.Add();
row3.Cells.Add("Rowheader 2", Font.HelveticaBold, 16, Grayscale.Black,
Grayscale.LightGrey, 1);
row3.Cells.Add("Item 2");
row3.Cells.Add("Item 3");
Row2 row4 = table.Rows.Add();
row4.Cells.Add("Rowheader 3", Font.HelveticaBold, 16, Grayscale.Black,
Grayscale.LightGrey, 1);
row4.Cells.Add("Item 4");
row4.Cells.Add("Item 5");
// Add the table to the page
page.Elements.Add(table);
// Save the PDF
document.Draw(outputPath);
}
}
Remarks
This method is used to add any text to a cell in a table.
Add(String, Font, Single?, Int32, Int32)
Adds a Cell2 to the end of the Cell2List .
public Cell2 Add(string text, Font font, float? fontSize, int colSpan, int rowSpan)
Function Add(text As String, font As Font, fontSize As Single?, colSpan As Integer, rowSpan As Integer) As Cell2
Parameters
- text: String
Text to be displayed in the cell.
- font: Font
Font for the text in the cell.
- fontSize: Single?
Font size for the text in the cell.
- colSpan: Int32
Number of columns that the cell will span.
- rowSpan: Int32
Number of rows that the cell will span.
Returns
Returns a Cell2 object.
Examples
The following example shows you how to build a simple table.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Module MyModule
Sub Main()
' Create a PDF Document
Dim MyDocument As Document = New Document
Dim MyPage As Page = New Page
MyDocument.Pages.Add(MyPage)
Dim MyTable As Table2 = New Table2(0, 0, 600, 600)
MyTable.CellDefault.Align = TextAlign.Center
MyTable.CellDefault.VAlign = VAlign.Center
MyTable.Border.LineStyle = LineStyle.Solid
MyTable.CellSpacing = 5.0f
' Add columns to the table
MyTable.Columns.Add(150)
MyTable.Columns.Add(150)
MyTable.Columns.Add(150)
' Add rows to the table and add cells to the rows
Dim MyRow1 As Row2 = MyTable.Rows.Add(0, Font.HelveticaBold, 16, _
Grayscale.Black, Grayscale.LightGrey)
MyRow1.Cells.Add("Header 1")
MyRow1.Cells.Add("Header 2")
MyRow1.Cells.Add("Header 3")
Dim MyRow2 As Row2 = MyTable.Rows.Add()
MyRow2.Cells.Add("Rowheader 1", Font.HelveticaBold, 16, Grayscale.Black, _
Grayscale.LightGrey, 1)
MyRow2.Cells.Add("Item 1", Font.Symbol, 20, 2, 2)
Dim MyRow3 As Row2 = MyTable.Rows.Add()
MyRow3.Cells.Add("Rowheader 2", Font.HelveticaBold, 16, Grayscale.Black, _
Grayscale.LightGrey, 1)
Dim MyRow4 As Row2 = MyTable.Rows.Add()
MyRow4.Cells.Add("Rowheader 3", Font.HelveticaBold, 16, Grayscale.Black, _
Grayscale.LightGrey, 1)
MyRow4.Cells.Add("Item 2")
MyRow4.Cells.Add("Item 3")
' Add the table to the page
MyPage.Elements.Add(MyTable)
' Save the PDF
MyDocument.Draw("C:\MyDocument.pdf")
End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
public class Example
{
public static void CreatePDF(string outputPath)
{
//Create a PDF Document
Document document = new Document();
Page page = new Page();
document.Pages.Add(page);
Table2 table = new Table2(0, 0, 600, 600);
table.CellDefault.Align = TextAlign.Center;
table.CellDefault.VAlign = VAlign.Center;
table.Border.LineStyle = LineStyle.Solid;
table.CellSpacing = 5.0f;
// Add columns to the table
table.Columns.Add(150);
table.Columns.Add(150);
table.Columns.Add(150);
// Add rows to the table and add cells to the rows
Row2 row1 = table.Rows.Add(0, Font.HelveticaBold, 16, Grayscale.Black,
Grayscale.LightGrey);
row1.Cells.Add("Header 1");
row1.Cells.Add("Header 2");
row1.Cells.Add("Header 3");
Row2 row2 = table.Rows.Add();
row2.Cells.Add("Rowheader 1", Font.HelveticaBold, 16, Grayscale.Black,
Grayscale.LightGrey, 1);
row2.Cells.Add("Item 1", Font.HelveticaOblique, 14, 2);
Row2 row3 = table.Rows.Add();
row3.Cells.Add("Rowheader 2", Font.HelveticaBold, 16, Grayscale.Black,
Grayscale.LightGrey, 1);
row3.Cells.Add("Item 2");
row3.Cells.Add("Item 3");
Row2 row4 = table.Rows.Add();
row4.Cells.Add("Rowheader 3", Font.HelveticaBold, 16, Grayscale.Black,
Grayscale.LightGrey, 1);
row4.Cells.Add("Item 4");
row4.Cells.Add("Item 5");
// Add the table to the page
page.Elements.Add(table);
// Save the PDF
document.Draw(outputPath);
}
}
Remarks
This method is used to add any text to a cell in a table.
Add(String, Int32)
Adds a Cell2 to the end of the Cell2List .
public Cell2 Add(string text, int colSpan)
Function Add(text As String, colSpan As Integer) As Cell2
Parameters
- text: String
Text to be displayed in the cell.
- colSpan: Int32
Number of columns that the cell will span.
Returns
Returns a Cell2 object.
Examples
The following example shows you how to build a simple table.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Module MyModule
Sub Main()
' Create a PDF Document
Dim MyDocument As Document = New Document
Dim MyPage As Page = New Page
MyDocument.Pages.Add(MyPage)
Dim MyTable As Table2 = New Table2(0, 0, 600, 600)
MyTable.CellDefault.Align = TextAlign.Center
MyTable.CellDefault.VAlign = VAlign.Center
MyTable.Border.LineStyle = LineStyle.Solid
MyTable.CellSpacing = 5.0f
' Add columns to the table
MyTable.Columns.Add(150)
MyTable.Columns.Add(150)
MyTable.Columns.Add(150)
' Add rows to the table and add cells to the rows
Dim MyRow1 As Row2 = MyTable.Rows.Add(0, Font.HelveticaBold, 16, Grayscale.Black, _
Grayscale.LightGrey)
MyRow1.Cells.Add("Header 1")
MyRow1.Cells.Add("Header 2")
MyRow1.Cells.Add("Header 3")
Dim MyRow2 As Row2 = MyTable.Rows.Add()
MyRow2.Cells.Add("Rowheader 1", Font.HelveticaBold, 16, Grayscale.Black, _
Grayscale.LightGrey, 1)
MyRow2.Cells.Add("Item 1")
MyRow2.Cells.Add("Item 2")
Dim MyRow3 As Row2 = MyTable.Rows.Add()
MyRow3.Cells.Add("Rowheader 2", Font.HelveticaBold, 16, Grayscale.Black, _
Grayscale.LightGrey, 1)
MyRow3.Cells.Add("Item 3")
MyRow3.Cells.Add("Item 4")
Dim MyRow4 As Row2 = MyTable.Rows.Add()
MyRow4.Cells.Add("Rowheader 3", Font.HelveticaBold, 16, Grayscale.Black, _
Grayscale.LightGrey, 1)
MyRow4.Cells.Add("Item 5", 2)
' Add the table to the page
MyPage.Elements.Add(MyTable)
' Save the PDF
MyDocument.Draw("C:\MyDocument.pdf")
End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
public class Example
{
public static void CreatePDF(string outputPath)
{
// Create a PDF Document
Document document = new Document();
Page page = new Page();
document.Pages.Add(page);
Table2 table = new Table2(0, 0, 600, 600);
table.CellDefault.Align = TextAlign.Center;
table.CellDefault.VAlign = VAlign.Center;
table.Border.LineStyle = LineStyle.Solid;
table.CellSpacing = 5.0f;
// Add columns to the table
table.Columns.Add(150);
table.Columns.Add(150);
table.Columns.Add(150);
// Add rows to the table and add cells to the rows
Row2 row1 = table.Rows.Add(0, Font.HelveticaBold, 16, Grayscale.Black,
Grayscale.LightGrey);
row1.Cells.Add("Header 1");
row1.Cells.Add("Header 2");
row1.Cells.Add("Header 3");
Row2 row2 = table.Rows.Add();
row2.Cells.Add("Rowheader 1", Font.HelveticaBold, 16, Grayscale.Black,
Grayscale.LightGrey, 1);
row2.Cells.Add("Item 1");
row2.Cells.Add("Item 2");
Row2 row3 = table.Rows.Add();
row3.Cells.Add("Rowheader 2", Font.HelveticaBold, 16, Grayscale.Black,
Grayscale.LightGrey, 1);
row3.Cells.Add("Item 3");
row3.Cells.Add("Item 4");
Row2 row4 = table.Rows.Add();
row4.Cells.Add("Rowheader 3", Font.HelveticaBold, 16, Grayscale.Black,
Grayscale.LightGrey, 1);
row4.Cells.Add("Item 5", 2);
// Add the table to the page
page.Elements.Add(table);
// Save the PDF
document.Draw(outputPath);
}
}
Remarks
This method is used to add any text to a cell in a table.
Add(String, Int32, Int32)
Adds a Cell2 to the end of the Cell2List .
public Cell2 Add(string text, int colSpan, int rowSpan)
Function Add(text As String, colSpan As Integer, rowSpan As Integer) As Cell2
Parameters
- text: String
Text to be displayed in the cell.
- colSpan: Int32
Number of columns that the cell will span.
- rowSpan: Int32
Number of rows that the cell will span.
Returns
Returns a Cell2 object.
Examples
The following example shows you how to build a simple table.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Module MyModule
Sub Main()
' Create a PDF Document
Dim MyDocument As Document = New Document
Dim MyPage As Page = New Page
MyDocument.Pages.Add(MyPage)
Dim MyTable As Table2 = New Table2(0, 0, 600, 600)
MyTable.CellDefault.Align = TextAlign.Center
MyTable.CellDefault.VAlign = VAlign.Center
MyTable.Border.LineStyle = LineStyle.Solid
MyTable.CellSpacing = 5.0f
' Add columns to the table
MyTable.Columns.Add(150)
MyTable.Columns.Add(150)
MyTable.Columns.Add(150)
' Add rows to the table and add cells to the rows
Dim MyRow1 As Row2 = MyTable.Rows.Add(0, Font.HelveticaBold, 16, _
Grayscale.Black, Grayscale.LightGrey)
MyRow1.Cells.Add("Header 1")
MyRow1.Cells.Add("Header 2")
MyRow1.Cells.Add("Header 3")
Dim MyRow2 As Row2 = MyTable.Rows.Add()
MyRow2.Cells.Add("Rowheader 1", Font.HelveticaBold, 16, Grayscale.Black, _
Grayscale.LightGrey, 1)
MyRow2.Cells.Add("Item 1", 2, 2)
Dim MyRow3 As Row2 = MyTable.Rows.Add()
MyRow3.Cells.Add("Rowheader 2", Font.HelveticaBold, 16, Grayscale.Black, _
Grayscale.LightGrey, 1)
Dim MyRow4 As Row2 = MyTable.Rows.Add()
MyRow4.Cells.Add("Rowheader 3", Font.HelveticaBold, 16, Grayscale.Black, _
Grayscale.LightGrey, 1)
MyRow4.Cells.Add("Item 2")
MyRow4.Cells.Add("Item 3")
' Add the table to the page
MyPage.Elements.Add(MyTable)
' Save the PDF
MyDocument.Draw("C:\MyDocument.pdf")
End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
public class Example
{
public static void CreatePDF(string outputPath)
{
// Create a PDF Document
Document document = new Document();
Page page = new Page();
document.Pages.Add( page );
Table2 table = new Table2(0, 0, 600, 600);
table.CellDefault.Align = TextAlign.Center;
table.CellDefault.VAlign = VAlign.Center;
table.Border.LineStyle = LineStyle.Solid;
table.CellSpacing = 5.0f;
// Add columns to the table
table.Columns.Add( 150 );
table.Columns.Add( 150 );
table.Columns.Add( 150 );
// Add rows to the table and add cells to the rows
Row2 row1 = table.Rows.Add( 0, Font.HelveticaBold, 16, Grayscale.Black,
Grayscale.LightGrey );
row1.Cells.Add( "Header 1" );
row1.Cells.Add( "Header 2" );
row1.Cells.Add( "Header 3" );
Row2 row2 = table.Rows.Add();
row2.Cells.Add( "Rowheader 1", Font.HelveticaBold, 16, Grayscale.Black,
Grayscale.LightGrey, 1 );
row2.Cells.Add( "Item 1", 2, 2 );
Row2 row3 = table.Rows.Add();
row3.Cells.Add( "Rowheader 2", Font.HelveticaBold, 16, Grayscale.Black,
Grayscale.LightGrey, 1 );
Row2 row4 = table.Rows.Add();
row4.Cells.Add( "Rowheader 3", Font.HelveticaBold, 16, Grayscale.Black,
Grayscale.LightGrey, 1 );
row4.Cells.Add( "Item 2" );
row4.Cells.Add( "Item 3" );
// Add the table to the page
page.Elements.Add( table );
// Save the PDF
document.Draw(outputPath);
}
}
Remarks
This method is used to add any text to a cell in a table.
Equals(Object)
Determines whether the specified Object is equal to the current Object . (Inherited from Object)
public bool Equals(Object obj)
Function Equals(obj As Object) As Boolean
Parameters
- obj: Object
The Object to compare with the current Object .
Returns
true if the specified Object is equal to the current Object ; otherwise, false.
GetEnumerator()
Returns an enumerator that can iterate through the Cell2 .
public IEnumerator GetEnumerator()
Function GetEnumerator() As IEnumerator
Returns
An IEnumerator for the entire Cell2 .
GetHashCode()
Serves as a hash function for a particular type. (Inherited from Object)
public int GetHashCode()
Function GetHashCode() As Integer
Returns
A hash code for the current Object .
GetType()
Gets the Type of the current instance. (Inherited from Object)
public Type GetType()
Function GetType() As Type
Returns
The Type instance that represents the exact runtime type of the current instance.
ToString()
Returns a String that represents the current Object . (Inherited from Object)
public string ToString()
Function ToString() As String
Returns
A String that represents the current Object .