PowerTools MultiRow for Windows Forms 8.0J
HorizontalPageBreak プロパティ
使用例 

Templateの幅が用紙の幅より大きい場合に水平方向に改ページするかどうかを示す値を取得または設定します。
構文
Public Property HorizontalPageBreak As Boolean
public bool HorizontalPageBreak {get; set;}

プロパティ値

水平方向に改ページする場合はtrue。それ以外の場合はfalse。既定値はtrueです。
解説
Templateの幅がページの幅より大きい場合に、あふれた部分を次の新しいページに印刷するときは、このプロパティをtrueに設定します。それ以外の場合はfalseに設定します。
使用例
次のサンプルコードは、PrintStyle.RichスタイルとPagingMode.SingleRowを使用してGcMultiRowを印刷する方法を示します。HorizontalPageBreaktrueの場合は、テンプレートの幅がページの幅より大きいとき、あふれた部分が新しいページに印刷されます。このサンプルコードは、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
参照

PrintSettings クラス
PrintSettings メンバ

 

 


© 2008-2015 GrapeCity inc. All rights reserved.