Gets the collection of row groups defined on the current RenderTable.
Namespace:
C1.C1PreviewAssembly: C1.C1Report.2 (in C1.C1Report.2.dll)
Syntax
C# |
---|
public TableVectorGroupCollection RowGroups { get; } |
Visual Basic |
---|
Public ReadOnly Property RowGroups As TableVectorGroupCollection Get |
Examples
The following example uses the RowGroups property to get the page header and style for the first and second group of rows:
Copy CodeVisual Basic
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load MakeDoc1(C1PrintDocument1) C1PrintDocument1.Generate() End Sub Private Sub MakeDoc1(ByVal doc As C1.C1Preview.C1PrintDocument) ' Create and fill the table. Dim rt As C1.C1Preview.RenderTable = New C1.C1Preview.RenderTable() Dim row As Integer Dim col As Integer For row = 0 To 10 - 1 Step +1 For col = 0 To 5 - 1 Step +1 rt.Cells(row, col).Text = String.Format("Text in cell({0}, {1})", row, col) Next Next ' Set the table and columns' widths. rt.Width = C1.C1Preview.Unit.Auto For col = 0 To 5 - 1 Step +1 rt.Cols(col).Width = "1in" Next ' Assign the first 2 rows as the header and set the background. rt.RowGroups(0, 2).PageHeader = True rt.RowGroups(0, 2).Style.BackColor = Color.Red ' Assign the last 2 rows as the footer and set the background. rt.RowGroups(5, 2).PageFooter = True rt.RowGroups(5, 2).Style.BackColor = Color.Blue doc.Body.Children.Add(rt) End Sub |
Copy CodeC#
private void Form1_Load(object sender, EventArgs e) { MakeDoc1(c1PrintDocument1); c1PrintDocument1.Generate(); } private void MakeDoc1(C1.C1Preview.C1PrintDocument doc) { // Create and fill the table. C1.C1Preview.RenderTable rt = new C1.C1Preview.RenderTable(); for (int row = 0; row < 10; ++row) { for (int col = 0; col < 5; ++col) { rt.Cells[row, col].Text = string.Format("Text in cell({0}, {1})", row, col); } } rt.Width = C1.C1Preview.Unit.Auto; for (int col = 0; col < 5; ++col) { rt.Cols[col].Width = "1in"; } // Assign the first 2 rows as the header and set the background. rt.RowGroups[0, 2].PageHeader = true; rt.RowGroups[0, 2].Style.BackColor = Color.Red; // Assign the last 2 rows as the footer and set the background. rt.RowGroups[5, 2].PageFooter = true; rt.RowGroups[5, 2].Style.BackColor = Color.Blue; doc.Body.Children.Add(rt); } |