public class Rows
extends com.aspose.ms.System.Collections.CollectionBase
Represents a collection of Row
objects.
[C#] Pdf pdf1 = new Pdf(); Section sec1 = pdf1.Sections.Add(); Aspose.Pdf.Generator.Table table1 = new Aspose.Pdf.Generator.Table(); sec1.Paragraphs.Add(table1); table1.ColumnWidths = "70 2cm"; Row row1 = table1.Rows.Add(); Cell cell1Row1 = row1.Cells.Add("ColumnsSpan = 2"); cell1Row1.ColumnsSpan = 2; cell1Row1.Border = new BorderInfo((int)BorderSide.All,0.5F); Row row2 = table1.Rows.Add(); Cell cell1Row2 = row2.Cells.Add("cell1"); cell1Row2.Border = new BorderInfo((int)BorderSide.All,0.5F); Cell cell2Row2 = row2.Cells.Add("cell2"); cell2Row2.Border = new BorderInfo((int)BorderSide.All,0.5F,new Aspose.Pdf.Generator.Color("Red")); pdf1.Save(...); [Visual Basic] Dim pdf1 As Pdf = New Pdf() Dim sec1 As Section = pdf1.Sections.Add() Dim table1 As Aspose.Pdf.Generator.Table = New Aspose.Pdf.Generator.Table() sec1.Paragraphs.Add(table1) table1.ColumnWidths = "70 2cm" Dim row1 As Row = table1.Rows.Add() Dim cell1Row1 As Cell = row1.Cells.Add("ColumnsSpan = 2") cell1Row1.ColumnsSpan = 2 cell1Row1.Border = New BorderInfo(CType(BorderSide.All, Integer), 0.5) Dim row2 As Row = table1.Rows.Add() Dim cell1Row2 As Cell = row2.Cells.Add("cell1") cell1Row2.Border = New BorderInfo(CType(BorderSide.All, Integer), 0.5) Dim cell2Row2 As Cell = row2.Cells.Add("cell2") cell2Row2.Border = New BorderInfo(CType(BorderSide.All, Integer), 0.5, New Aspose.Pdf.Generator.Color("Red")) pdf1.Save(...) [XML] <Pdf xmlns="Aspose.Pdf"> <Section> <Table ColumnWidths="70 2cm"> <Row> <Cell ColumnsSpan="2"> <Border> <All LineWidth="0.5"></All> </Border> <Text> <Segment>ColumnsSpan = 2</Segment> </Text> </Cell> </Row> <Row> <Cell> <Border> <All LineWidth="0.5"></All> </Border> <Text> <Segment>cell1</Segment> </Text> </Cell> <Cell> <Border> <All LineWidth="0.5" Color="Red"></All> </Border> <Text> <Segment>cell2</Segment> </Text> </Cell> </Row> </Table> </Section> </Pdf>
Constructor and Description |
---|
Rows()
Initializes a new instance of the
Rows class. |
Modifier and Type | Method and Description |
---|---|
Row |
add()
Initializes a new instance of the
Row class and add it to the Rows collection. |
void |
add(Row row)
Adds a new
Row object into the collection. |
void |
addRow(Row row)
Adds a new
Row object into the collection. |
void |
addRow(Section section,
Row row)
Adds a new
Row object into pdf file, this method is used for direct-to-stream mode. |
void |
copyTo(Row[] rowArray,
int index)
Copies the elements to a
Row object array, starting at a specified array index. |
Row |
get_Item(int index)
Gets or sets a
Row object from the collection according to Row index. |
Row |
get_Item(String rowID)
Gets or sets a
Row object from the collection according to Row ID. |
int |
indexOf(Row row)
Gets the index of a specified row in the collection.
|
void |
insert(int index,
Row row)
Inserts a new
Row object into the collection at specified position. |
void |
insert(Row rowToInsertAfter,
Row newRow)
Inserts a new
Row object into the collection after specified Cell object. |
void |
moveAfter(Row rowToMoveAfter,
Rows newRows) |
void |
remove(Row rowToRemove)
Removes a
Row object from the collection. |
void |
set_Item(int index,
Row value) |
void |
set_Item(String rowID,
Row value) |
void |
setTable(Table value) |
public void addRow(Row row)
Adds a new Row
object into the collection.
row
- The Row
object to be added.public void addRow(Section section, Row row)
Adds a new Row
object into pdf file, this method is used for direct-to-stream mode.
When calling this method, the added row will be writen into pdf file directly. Direct-to-stream mode is very useful for processing large paragraphs.
In this mode, however, you can't access the rows that added into the document any more, so some of the advanced features such as combination of XML and API,
hyperlink to specified paragraph, total page number in footer,etc.,is not available.
section
- The Section
Section the table belongs to.row
- The Row
Row to be added.public void add(Row row)
Adds a new Row
object into the collection.
row
- The Row
object to be added.public Row add()
Initializes a new instance of the Row
class and add it to the Rows collection.
Row
object.public void setTable(Table value)
public Row get_Item(int index)
Gets or sets a Row
object from the collection according to Row index.
get_Item
in interface com.aspose.ms.System.Collections.IList
get_Item
in class com.aspose.ms.System.Collections.CollectionBase
public void set_Item(int index, Row value)
public Row get_Item(String rowID)
Gets or sets a Row
object from the collection according to Row ID.
public void insert(int index, Row row)
Inserts a new Row
object into the collection at specified position.
index
- The zero-based index at which Row
object should be inserted.row
- The Row
object to be inserted.public void insert(Row rowToInsertAfter, Row newRow)
Inserts a new Row
object into the collection after specified Cell object.
rowToInsertAfter
- The Row
object to insert after.newRow
- The Row
object to be inserted.public int indexOf(Row row)
Gets the index of a specified row in the collection.
row
- The specified row.public void remove(Row rowToRemove)
Removes a Row
object from the collection.
rowToRemove
- The Row
object to be romoved.public void moveAfter(Row rowToMoveAfter, Rows newRows)
rowToMoveAfter
- newRows
- public void copyTo(Row[] rowArray, int index)
Copies the elements to a Row
object array, starting at a specified array index.
rowArray
- The Row
object array.index
- The start index.Copyright © 2016 Aspose. All Rights Reserved.