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

PagingModePagingMode.MultiColumnsモードの場合のセクションの印刷方法を示す値を取得または設定します。
構文
Public Property MultiColumnsPrintOrder As PrintOrder
public PrintOrder MultiColumnsPrintOrder {get; set;}

プロパティ値

PrintOrder値の1つ。既定値はPrintOrder.DownThenOverです。
例外
例外解説
System.ComponentModel.InvalidEnumArgumentException指定された値がPrintOrder値の1つではありません。
解説
PagingModePagingMode.MultiColumnsの場合は、すべてのセクションを1ページにどのように配置するかを指定できます。PrintOrder.OverThenDownを選択すると、すべてのSectionがページの左から右へ配置されます。現在のページの1行がいっぱいになると、残りのSectionが次の行の左端から右へ(この行がいっぱいになるまで)印刷されます。PrintOrder.DownThenOverを選択すると、すべてのSectionがページの上から下へ配置され、現在のページの1列がいっぱいになると、残りのSectionが次の列の上端から下へ(この列がいっぱいになるまで)印刷されます。
使用例
次のサンプルコードは、PrintStyle.ContentスタイルとPagingMode.MultiColumnsを使用してGcMultiRowを印刷する方法を示します。MultiColumnsPrintOrderプロパティを使用して、PagingMode.MultiColumnsモードでのすべての行の印刷順序を指定します。このサンプルコードは、GcMultiRow.PrintSettingsに示されている詳細なコード例の一部を抜粋したものです。
void setContentAndMultiColumnButton_Click(object sender, EventArgs e)
{
    Template template1 = CreateTemplate(1, 21);
    AddPrintInfoCellColumnFooterSection(template1, 21);
    this.gcMultiRow1.Template = template1;
    gcMultiRow1.RowCount = 81;

    //Only the content(Text,Image) is printed, the backgound, border will not be printed.
    gcMultiRow1.PrintSettings.PrintStyle = PrintStyle.Content;
    gcMultiRow1.PrintSettings.AutoFitWidth = false;
    //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.MultiColumns;
    //The all Columns in each page will be aligned by MiddleCenter.
    gcMultiRow1.PrintSettings.Alignment = MultiRowContentAlignment.MiddleCenter;
    //All Rows will be printed.
    gcMultiRow1.PrintSettings.PrintRange = MultiRowPrintRange.AllRows;
    //In MultiColumns mode, on each Column's head, the ColumnHeader is filled. If you can set this to FirstPage, only first Column exists one ColumnHeader.
    gcMultiRow1.PrintSettings.PrintHeader = PrintHeader.AllPages;
    //Between each Column in page, there will exist 15 pixels space.
    gcMultiRow1.PrintSettings.ColumnMargin = 15;

    if (flag)
    {
        gcMultiRow1.PrintSettings.MultiColumnsPrintOrder = PrintOrder.OverThenDown;
        flag = false;
    }
    else
    {
        gcMultiRow1.PrintSettings.MultiColumnsPrintOrder = PrintOrder.DownThenOver;
        flag = true;
    }
    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 = "In Content style, only the Text and Image are printed; In MultiColumns mode, the MultiColumnsPrintOrder can control all Rows printing order; The ColumnMargin property will set 15 pixels space between each column;(Click this button again, the MultiColumnsPrintOrder will change to another effect.)";
}
Private Sub setContentAndMultiColumnButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles setContentAndMultiColumnButton.Click
    Dim template1 As Template = CreateTemplate(1, 21)
    AddPrintInfoCellColumnFooterSection(template1, 21)
    Me.gcMultiRow1.Template = template1
    gcMultiRow1.RowCount = 81

    'Only the content(Text,Image) is printed, the backgound, border will not be printed.
    gcMultiRow1.PrintSettings.PrintStyle = PrintStyle.Content
    gcMultiRow1.PrintSettings.AutoFitWidth = False
    '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.MultiColumns
    'The all Columns in each page will be aligned by MiddleCenter.
    gcMultiRow1.PrintSettings.Alignment = MultiRowContentAlignment.MiddleCenter
    'All Rows will be printed.
    gcMultiRow1.PrintSettings.PrintRange = MultiRowPrintRange.AllRows
    'In MultiColumns mode, on each Column's head, the ColumnHeader is filled. If you can set this to FirstPage, only first Column exists one ColumnHeader.
    gcMultiRow1.PrintSettings.PrintHeader = PrintHeader.AllPages
    'Between each Column in page, there will exist 15 pixels space.
    gcMultiRow1.PrintSettings.ColumnMargin = 15

    If flag Then
        gcMultiRow1.PrintSettings.MultiColumnsPrintOrder = PrintOrder.OverThenDown
        flag = False
    Else
        gcMultiRow1.PrintSettings.MultiColumnsPrintOrder = PrintOrder.DownThenOver
        flag = True
    End If
    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 = "In Content style, only the Text and Image are printed; In MultiColumns mode, the MultiColumnsPrintOrder can control all Rows printing order; The ColumnMargin property will set 15 pixels space between each column;(Click this button again, the MultiColumnsPrintOrder will change to another effect.)"
End Sub
参照

PrintSettings クラス
PrintSettings メンバ
PagingMode プロパティ
Section クラス

 

 


© 2008-2015 GrapeCity inc. All rights reserved.