PowerTools MultiRow for Windows Forms 8.0J
PrintHeader 列挙体
使用例 使用例 

列ヘッダの印刷方法を指定します。
構文
Public Enum PrintHeader 
   Inherits System.Enum
public enum PrintHeader : System.Enum 
メンバ
メンバ解説
AllPagesすべてのページに列ヘッダが印刷されます。
FirstPage最初のページに列ヘッダが印刷されます。
None列ヘッダは印刷されません。
使用例
次のサンプルコードは、PrintStyle.RichスタイルとPagingMode.SingleRowを使用してGcMultiRowを印刷する方法を示します。各ページには、1行のRowに加えて、ページ上部にColumnHeaderが印刷されます。このサンプルコードは、GcMultiRow.PrintSettingsに示されている詳細なコード例の一部を抜粋したものです。
void setRichAndSingleRowButton_Click(object sender, EventArgs e)
{
    Template template1 = CreateTemplate(10, 100);
    AddPrintInfoCellColumnFooterSection(template1, 100);
    this.gcMultiRow1.Template = template1;
    gcMultiRow1.RowCount = 5;

    //All elements will be printed.
    gcMultiRow1.PrintSettings.PrintStyle = PrintStyle.Rich;
    //Only one Row will be printed to one page. You can print ColumnHeader to each page through setting PrintHeader property to AllPages.
    gcMultiRow1.PrintSettings.PagingMode = PagingMode.SingleRow;
    //The GcMultiRow will be aligned by MiddleCenter.
    gcMultiRow1.PrintSettings.Alignment = MultiRowContentAlignment.MiddleCenter;
    //All Rows will be printed.
    gcMultiRow1.PrintSettings.PrintRange = MultiRowPrintRange.AllRows;
    //In each page, besides one Row, the ColumnHeader will be printed in the page's head.
    gcMultiRow1.PrintSettings.PrintHeader = PrintHeader.AllPages;
    //In each page, besides one Row, the ColumnFooter will be 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 part will be printed to new page.
        gcMultiRow1.PrintSettings.HorizontalPageBreak = true;
        flag = false;
    }
    else
    {
        //If Template's width is greater than page's width, the excess part will be clipped.
        gcMultiRow1.PrintSettings.HorizontalPageBreak = false;
        flag = true;
    }
    gcMultiRow1.PrintSettings.AutoFitWidth = false;
    gcMultiRow1.PrintSettings.ZoomFactor = 1f;
    try
    {
        gcMultiRow1.PrintPreview();
        //If you have a printer, you can execute the following code directly instead code above.
        //gcMultiRow1.Print(true);
    }
    catch (Exception ex)
    {
        // Can't find printer driver.
        MessageBox.Show(ex.Message);
    }
    label.Text = "The each Row will be printed in each page with the ColumnHeader; The GcMultiRow will be aligned by MiddleCenter; Because the Template's width is greater than page's width, The HorizontalPageBreak will control whether the excess part will be printed to new page.(Click the button again to chang 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 will be printed.
    gcMultiRow1.PrintSettings.PrintStyle = PrintStyle.Rich
    'Only one Row will be printed to one page. You can print ColumnHeader to each page through setting PrintHeader property to AllPages.
    gcMultiRow1.PrintSettings.PagingMode = PagingMode.SingleRow
    'The GcMultiRow will be aligned by MiddleCenter.
    gcMultiRow1.PrintSettings.Alignment = MultiRowContentAlignment.MiddleCenter
    'All Rows will be printed.
    gcMultiRow1.PrintSettings.PrintRange = MultiRowPrintRange.AllRows
    'In each page, besides one Row, the ColumnHeader will be printed in the page's head.
    gcMultiRow1.PrintSettings.PrintHeader = PrintHeader.AllPages
    'In each page, besides one Row, the ColumnFooter will be 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 part will be printed to new page.
        gcMultiRow1.PrintSettings.HorizontalPageBreak = True
        flag = False
    Else
        'If Template's width is greater than page's width, the excess part will be clipped.
        gcMultiRow1.PrintSettings.HorizontalPageBreak = False
        flag = True
    End If
    gcMultiRow1.PrintSettings.AutoFitWidth = False
    gcMultiRow1.PrintSettings.ZoomFactor = 1.0F
    Try
        'If you have a printer, you can execute the following code directly instead code above.
        'gcMultiRow1.Print(true);
        gcMultiRow1.PrintPreview()
    Catch ex As Exception
        ' Can't find printer driver.
        MessageBox.Show(ex.Message)
    End Try
    label.Text = "The each Row will be printed in each page with the ColumnHeader; The GcMultiRow will be aligned by MiddleCenter; Because the Template's width is greater than page's width, The HorizontalPageBreak will control whether the excess part will be printed to new page.(Click the button again to chang the HorizontalPageBreak's effect)"
End Sub
継承階層

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

参照

GrapeCity.Win.MultiRow 名前空間
PrintSettings クラス

 

 


© 2008-2015 GrapeCity inc. All rights reserved.