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