GrapeCity MultiRow Windows Forms Documentation
PrintInfoCell Class
Members  Example 


Represents a Cell that displays current printing information when printing.
Object Model
PrintInfoCell ClassGcMultiRow ClassCellStyle ClassCellNote ClassSection ClassCellStyle ClassMultiRowTouchToolBar ClassValidatorCollection ClassCellValidator Class
Syntax
<ToolboxItemFilterAttribute(FilterString="GrapeCity.Win.MultiRow.Template7", FilterType=ToolboxItemFilterType.Custom Or  _
    ToolboxItemFilterType.Prevent Or  _
    ToolboxItemFilterType.Require)>
<DesignerAttribute(DesignerBaseTypeName="System.ComponentModel.Design.IDesigner", DesignerTypeName="GrapeCity.Win.MultiRow.Design.PrintInfoCellDesigner,GrapeCity.Win.MultiRow.Design, Version=7.20.20141.0, Culture=neutral, PublicKeyToken=0f7a722ee3c2bdd9")>
<BindableCellAttribute(False)>
<ToolboxBitmapAttribute()>
<ValueTypeEditorAttribute(TypeName="System.Drawing.Design.UITypeEditor, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", AavailableForNullValue=True)>
<SRDescriptionAttribute("Displays print information such as page number, print date, and so on.")>
<DefaultPropertyAttribute("FormatString")>
Public Class PrintInfoCell 
   Inherits LabelCell
Dim instance As PrintInfoCell
[ToolboxItemFilter(FilterString="GrapeCity.Win.MultiRow.Template7", FilterType=ToolboxItemFilterType.Custom | 
    ToolboxItemFilterType.Prevent | 
    ToolboxItemFilterType.Require)]
[Designer(DesignerBaseTypeName="System.ComponentModel.Design.IDesigner", DesignerTypeName="GrapeCity.Win.MultiRow.Design.PrintInfoCellDesigner,GrapeCity.Win.MultiRow.Design, Version=7.20.20141.0, Culture=neutral, PublicKeyToken=0f7a722ee3c2bdd9")]
[BindableCell(false)]
[ToolboxBitmap()]
[ValueTypeEditor(TypeName="System.Drawing.Design.UITypeEditor, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", AavailableForNullValue=true)]
[SRDescription("Displays print information such as page number, print date, and so on.")]
[DefaultProperty("FormatString")]
public class PrintInfoCell : LabelCell 
Remarks
You can print page information in each page, such as the total page count, current printing page number, or the date and time.
Example
The following code example shows how to use the PrintInfoCell to display the print information when printing. This example is part of a larger example available for the GcMultiRow.PrintSettings.
void AddPrintInfoCellColumnFooterSection(Template template, int height)
        {
            ColumnFooterSection columnFooterSection1 = new ColumnFooterSection();
            columnFooterSection1.Height = height;

            PrintInfoCell printInfoCell1 = new PrintInfoCell();
            printInfoCell1.Size = new Size(500, height);
            printInfoCell1.Location = new Point(template.Width - 500, 0);
            printInfoCell1.Style.Border = Border.Empty;
            printInfoCell1.Style.TextAlign = MultiRowContentAlignment.MiddleRight;

            CultureInfo provider = new CultureInfo("ja-JP",true);
            provider.DateTimeFormat.Calendar = new JapaneseCalendar();
            printInfoCell1.Style.FormatProvider = provider;
            //Indicate the page number and DateTime.
            printInfoCell1.FormatString = "{PageNumber:}/{PageCount:} {DateTime:yyyy年MM月dd日}";
            //You can add other information when printing, such as UserName, CompanyName and so on.
            //printInfoCell1.FormatString = String.Format("{{DateTime:yyyy年MM月dd日}} {0} {1} ",new object[] { Environment.UserName, Application.CompanyName });

            columnFooterSection1.Cells.Add(printInfoCell1);
            template.ColumnFooters.Add(columnFooterSection1);
        }
Private Sub AddPrintInfoCellColumnFooterSection(ByVal template As Template, ByVal height As Integer)
        Dim columnFooterSection1 As New ColumnFooterSection()
        columnFooterSection1.Height = height

        Dim printInfoCell1 As New PrintInfoCell()
        printInfoCell1.Size = New Size(500, height)
        printInfoCell1.Location = New Point(template.Width - 500, 0)
        printInfoCell1.Style.Border = Border.Empty
        printInfoCell1.Style.TextAlign = MultiRowContentAlignment.MiddleRight

        Dim provider As New CultureInfo("ja-JP", True)
        provider.DateTimeFormat.Calendar = New JapaneseCalendar()
        printInfoCell1.Style.FormatProvider = provider
        'Indicate the page number and DateTime.
        printInfoCell1.FormatString = "{PageNumber:}/{PageCount:} {DateTime:yyyy年MM月dd日}"
        'You can add other information when printing, such as UserName, CompanyName and so on.
        'printInfoCell1.FormatString = String.Format("{{DateTime:yyyy年MM月dd日}} {0} {1} ",new object[] { Environment.UserName, Application.CompanyName });

        columnFooterSection1.Cells.Add(printInfoCell1)
        template.ColumnFooters.Add(columnFooterSection1)
    End Sub
Inheritance Hierarchy

System.Object
   System.MarshalByRefObject
      System.ComponentModel.Component
         GrapeCity.Win.MultiRow.Cell
            GrapeCity.Win.MultiRow.LabelCell
               GrapeCity.Win.MultiRow.PrintInfoCell

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

PrintInfoCell Members
GrapeCity.Win.MultiRow Namespace
Cell Class
Print Method
PrintSettings Class

 

 


Copyright © GrapeCity, inc. All rights reserved.