Gets or sets the alignment of the current style's owner object within its container in a block flow.
Namespace:
C1.C1PreviewAssembly: C1.C1Report.2 (in C1.C1Report.2.dll)
Syntax
C# |
---|
public FlowAlignEnum FlowAlign { get; set; } |
Visual Basic |
---|
Public Property FlowAlign As FlowAlignEnum Get Set |
Remarks
This property is non-ambient (inherited from the Parent of the current style if not explicitly set).
The default is Default.
Examples
Add the following code to the Form_Load event to create a table and center it on the page using the Style.FlowAlign property:
Copy CodeVisual Basic
' Create a table. Dim table As New C1.C1Preview.RenderTable(Me.C1PrintDocument1) table.Style.GridLines.All = New C1.C1Preview.LineDef(Color.DarkGray) table.Width = 3 ' Add 3 rows. Const r As Integer = 3 ' Add 3 columns. Const c As Integer = 3 For row As Integer = 0 To r - 1 For col As Integer = 0 To c - 1 Dim celltext As New C1.C1Preview.RenderText(Me.C1PrintDocument1) celltext.Text = String.Format("Cell ({0}, {1})", row, col) ' Add cells with text. table.Cells(row, col).RenderObject = celltext Next Next ' Center the table on the page. table.Style.FlowAlign = FlowAlignEnum.Center ' Generate the document. Me.C1PrintDocument1.Body.Children.Add(table) Me.C1PrintDocument1.Generate() |
Copy CodeC#
// Create a table. C1.C1Preview.RenderTable table = new C1.C1Preview.RenderTable(this.c1PrintDocument1); table.Style.GridLines.All = new C1.C1Preview.LineDef(Color.DarkGray); table.Width = 3; // Add 3 rows. const int r = 3; // Add 3 columns. const int c = 3; for (int row = 0; row < r; ++row) { for (int col = 0; col < c; ++col) { C1.C1Preview.RenderText celltext = new C1.C1Preview.RenderText(this.c1PrintDocument1); celltext.Text = string.Format("Cell ({0}, {1})", row, col); // Add cells with text. table.Cells[row, col].RenderObject = celltext; } } // Center the table on the page. table.Style.FlowAlign = FlowAlignEnum.Center; // Generate the document. this.c1PrintDocument1.Body.Children.Add(table); this.c1PrintDocument1.Generate(); |