GrapeCity MultiRow Windows Forms Documentation
PrintHeader Enumeration
Example Example 


Specifies how to print the column headers.
Syntax
<SerializableAttribute()>
Public Enum PrintHeader 
   Inherits System.Enum
Dim instance As PrintHeader
[Serializable()]
public enum PrintHeader : System.Enum 
Members
MemberDescription
AllPagesThe column headers are printed on all pages.
FirstPageThe column headers are printed on the first page.
NoneThe column headers are not printed.
Example
The following code example shows how to use the PrintStyle.Rich style and the PagingMode.SingleRow mode to print the GcMultiRow control. In each page, one row and the column header are printed in the page's head. This example is part of a larger example available in the GcMultiRow.PrintSettings code example.
void setRichAndSingleRowButton_Click(object sender, EventArgs e)
        {
            Template template1 = CreateTemplate(10, 100);
            AddPrintInfoCellColumnFooterSection(template1, 100);
            this.gcMultiRow1.Template = template1;
            gcMultiRow1.RowCount = 5;

            //All elements are printed.
            gcMultiRow1.PrintSettings.PrintStyle = PrintStyle.Rich;
            //Only one Row is printed to one page. You can print ColumnHeader to each page by setting PrintHeader to 
AllPages.
            gcMultiRow1.PrintSettings.PagingMode = PagingMode.SingleRow;
            //The GcMultiRow is aligned by MiddleCenter.
            gcMultiRow1.PrintSettings.Alignment = MultiRowContentAlignment.MiddleCenter;
            //All Rows are printed.
            gcMultiRow1.PrintSettings.PrintRange = MultiRowPrintRange.AllRows;
            //In each page, besides one Row, the ColumnHeader is printed in the page's head.
            gcMultiRow1.PrintSettings.PrintHeader = PrintHeader.AllPages;
            //In each page, besides one Row, the ColumnFooter is printed in the page's tail.
            gcMultiRow1.PrintSettings.PrintFooter = PrintFooter.AllPages;
            if (flag)
            {
                //If Template's width is greater than page's width, the excess is printed to a new page.
                gcMultiRow1.PrintSettings.HorizontalPageBreak = true;
                flag = false;
            }
            else
            {
                //If Template's width is greater than page's width, the excess is clipped.
                gcMultiRow1.PrintSettings.HorizontalPageBreak = false;
                flag = true;
            }
            gcMultiRow1.PrintSettings.AutoFitWidth = false;
            gcMultiRow1.PrintSettings.ZoomFactor = 1f;
            try
            {
                gcMultiRow1.PrintPreview();
                //If you have a printer, execute the following code directly instead.
                //gcMultiRow1.Print(true);
            }
            catch (Exception ex)
            {
                // Can't find printer driver.
                MessageBox.Show(ex.Message);
            }
            label.Text = "Each Row is printed in each page with the ColumnHeader; The GcMultiRow is aligned by 
MiddleCenter; Because the Template's width is greater than page's width, The HorizontalPageBreak controls whether 
the excess is printed to a new page (click the button again to change the HorizontalPageBreak's effect)";
        }
Private Sub setRichAndSingleRowButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles 
setRichAndSingleRowButton.Click
        Dim template1 As Template = CreateTemplate(10, 100)
        AddPrintInfoCellColumnFooterSection(template1, 100)
        Me.gcMultiRow1.Template = template1
        gcMultiRow1.RowCount = 5

        'All elements are printed.
        gcMultiRow1.PrintSettings.PrintStyle = PrintStyle.Rich
        'Only one Row is printed to one page. You can print ColumnHeader on each page by setting PrintHeader to 
AllPages.
        gcMultiRow1.PrintSettings.PagingMode = PagingMode.SingleRow
        'The GcMultiRow is aligned by MiddleCenter.
        gcMultiRow1.PrintSettings.Alignment = MultiRowContentAlignment.MiddleCenter
        'All Rows are printed.
        gcMultiRow1.PrintSettings.PrintRange = MultiRowPrintRange.AllRows
        'In each page, besides one Row, the ColumnHeader is printed in the page's head.
        gcMultiRow1.PrintSettings.PrintHeader = PrintHeader.AllPages
        'In each page, besides one Row, the ColumnFooter is printed in the page's tail.
        gcMultiRow1.PrintSettings.PrintFooter = PrintFooter.AllPages

        If flag Then
            'If Template's width is greater than page's width, the excess is printed to a new page.
            gcMultiRow1.PrintSettings.HorizontalPageBreak = True
            flag = False
        Else
            'If Template's width is greater than page's width, the excess is clipped.
            gcMultiRow1.PrintSettings.HorizontalPageBreak = False
            flag = True
        End If
        gcMultiRow1.PrintSettings.AutoFitWidth = False
        gcMultiRow1.PrintSettings.ZoomFactor = 1.0F
        Try
            'If you have a printer, execute the following code directly instead.
            'gcMultiRow1.Print(true);
            gcMultiRow1.PrintPreview()
        Catch ex As Exception
            ' Can't find printer driver.
            MessageBox.Show(ex.Message)
        End Try
        label.Text = "Each Row is printed in each page with the ColumnHeader; The GcMultiRow is aligned by 
MiddleCenter; Because the Template's width is greater than page's width, The HorizontalPageBreak controls whether 
the excess is printed to a new page (click the button again to change the HorizontalPageBreak's effect)"
    End Sub
Inheritance Hierarchy

System.Object
   System.ValueType
      System.Enum
         GrapeCity.Win.MultiRow.PrintHeader

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

GrapeCity.Win.MultiRow Namespace
PrintSettings Class

 

 


Copyright © GrapeCity, inc. All rights reserved.