GrapeCity.Win.MultiRow Namespace > PrintInfoCell Class : FormatString Property |
<SRCategoryAttribute("Appearance")> <EditorAttribute(EditorBaseTypeName="System.Drawing.Design.UITypeEditor, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", EditorTypeName="GrapeCity.Win.MultiRow.FormatStringEditor, GrapeCity.Win.MultiRow, Version=7.20.20141.0, Culture=neutral, PublicKeyToken=0f7a722ee3c2bdd9")> <LocalizableAttribute(True)> <SRDescriptionAttribute("Indicates what format or printing information is displayed.")> Public Property FormatString As String
Dim instance As PrintInfoCell Dim value As String instance.FormatString = value value = instance.FormatString
[SRCategory("Appearance")] [Editor(EditorBaseTypeName="System.Drawing.Design.UITypeEditor, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", EditorTypeName="GrapeCity.Win.MultiRow.FormatStringEditor, GrapeCity.Win.MultiRow, Version=7.20.20141.0, Culture=neutral, PublicKeyToken=0f7a722ee3c2bdd9")] [Localizable(true)] [SRDescription("Indicates what format or printing information is displayed.")] public string FormatString {get; set;}
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
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