This topic demonstrates how to add a background color to the page header, and uses the following objects:
Complete the following steps:
To write code in Visual Basic
| Visual Basic |
Copy Code
|
|---|---|
Me.C1PrintDocument1.StartDoc() Dim theader As New C1.C1Preview.RenderTable(Me.C1PrintDocument1) |
|
To write code in C#
| C# |
Copy Code
|
|---|---|
this.c1PrintDocument1.StartDoc(); C1.C1Preview.RenderTable theader = new C1.C1Preview.RenderTable(this.c1PrintDocument1); |
|
To write code in Visual Basic
| Visual Basic |
Copy Code
|
|---|---|
theader.Style.BackColor = Color.Gold |
|
To write code in C#
| C# |
Copy Code
|
|---|---|
theader.Style.BackColor = Color.Gold; |
|
To write code in Visual Basic
| Visual Basic |
Copy Code
|
|---|---|
theader.Cells(0, 0).Style.TextAlignHorz = C1.C1Preview.AlignHorzEnum.Right
' Set up some styles.
theader.CellStyle.Font = New Font("Arial", 14)
' Assign text.
theader.Cells(0, 0).Text = "Swim Team Practice Schedule"
' Set the table as the page header.
Me.C1PrintDocument1.RenderBlock(theader)
Me.C1PrintDocument1.EndDoc()
|
|
To write code in C#
| C# |
Copy Code
|
|---|---|
theader.Cells[0, 0].Style.TextAlignHorz = C1.C1Preview.AlignHorzEnum.Right;
// Set up some styles.
theader.CellStyle.Font = new Font("Arial", 14);
// Assign text.
theader.Cells[0, 0].Text = "Swim Team Practice Schedule";
// Set the table as the page header.
this.c1PrintDocument1.RenderBlock(theader);
this.c1PrintDocument1.EndDoc();
|
|
Your header should look similar to the following header:
