本文整理匯總了C#中iTextSharp.text.pdf.PdfPTable.AddRow方法的典型用法代碼示例。如果您正苦於以下問題:C# PdfPTable.AddRow方法的具體用法?C# PdfPTable.AddRow怎麽用?C# PdfPTable.AddRow使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類iTextSharp.text.pdf.PdfPTable
的用法示例。
在下文中一共展示了PdfPTable.AddRow方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ExecuteResult
public override void ExecuteResult(ControllerContext context)
{
var Response = context.HttpContext.Response;
Response.ContentType = "application/pdf";
Response.AddHeader("content-disposition", "filename=foo.pdf");
dt = Util.Now;
doc = new Document(PageSize.LETTER, 36, 36, 36, 36);
var w = PdfWriter.GetInstance(doc, Response.OutputStream);
w.PageEvent = pageEvents;
doc.Open();
dc = w.DirectContent;
ct = new ColumnText(dc);
if (!qid.HasValue)
doc.Add(new Phrase("no data"));
else
{
pageEvents.StartPageSet("Outreach/Inreach Report: {0:d}".Fmt(dt));
IQueryable<ProspectInfo> q = GetProspectInfo(AlphaSort);
if (!q.Any())
doc.Add(new Phrase("no data"));
else
foreach (var p in q)
{
doc.NewPage();
var t = new PdfPTable(new float[] { 62f, 61f, 67f });
t.SetNoPadding();
var t1 = new PdfPTable(1);
t1.SetNoBorder();
var t2 = new PdfPTable(new float[] { 30f, 31f });
t2.SetNoBorder();
var t3 = new PdfPTable(new float[] { 27f, 40f });
t3.SetNoBorder();
var ph = new Paragraph();
ph.Add(new Chunk(p.Name, bfont));
ph.Add(new Chunk(" ({0})".Fmt(p.PeopleId), smallfont));
t1.AddCell(ph);
ph = new Paragraph();
ph.AddLine(p.Address, font);
ph.AddLine(p.Address2, font);
ph.AddLine(p.CityStateZip, font);
ph.Add("\n");
ph.AddLine(p.HomePhone.FmtFone("H"), font);
ph.AddLine(p.CellPhone.FmtFone("C"), font);
ph.AddLine(p.EMail, font);
t1.AddCell(ph);
t.AddCell(t1);
t2.Add("Position in Family:", font);
t2.Add(p.PositionInFamily, font);
t2.Add("Gender:", font);
t2.Add(p.Gender, font);
t2.Add("Marital Status:", font);
t2.Add(p.MaritalStatus, font);
t2.Add("", font);
t2.CompleteRow();
if (p.ChristAsSavior.HasValue())
t2.Add(p.ChristAsSavior, 2, font);
if (p.InfoBecomeAChristian.HasValue())
t2.Add(p.InfoBecomeAChristian, 2, font);
if (p.InterestedInJoining.HasValue())
t2.Add(p.InterestedInJoining, 2, font);
if (p.PleaseVisit.HasValue())
t2.Add(p.PleaseVisit, 2, font);
t.AddCell(t2);
t3.Add("Member Status:", font);
t3.Add(p.MemberStatus, font);
t3.Add("Origin:", font);
t3.Add(p.Origin, font);
t3.Add("Age:", font);
t3.Add(p.Age, font);
t3.Add("Comments:", 2, font);
t3.Add(p.Comment, 2, font);
t.AddCell(t3);
doc.Add(t);
if (p.Family.Count() > 0)
{
t = new PdfPTable(5);
t.SetNoBorder();
t.AddRow("Family Summary", bfont);
t.AddHeader("Name", bfont);
t.AddHeader("Age", bfont);
t.AddHeader("Cell Phone", bfont);
t.AddHeader("Position in Family", bfont);
t.AddHeader("Member Status", bfont);
foreach (var fm in p.Family)
{
t.Add(fm.Name, font);
t.Add(fm.Age.ToString(), font);
t.Add(fm.CellPhone.FmtFone(), font);
t.Add(fm.PositionInFamily, font);
t.Add(fm.MemberStatus, font);
//.........這裏部分代碼省略.........