Created
April 2, 2013 19:07
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void WriteWorkItems(string chapterText, ref int chapterNumber, IEnumerable<ReleaseNoteWorkItem> workItems) | |
{ | |
if (!workItems.Any()) | |
return; | |
_document.NewPage(); | |
string chapterTitle = string.Format(CultureInfo.InvariantCulture, "{0}. {1}", chapterNumber++, chapterText); | |
var chapter = new Chunk(chapterTitle, _chapterFont); | |
var paragraph = new Paragraph(20f, chapter); | |
chapter.SetLocalDestination(_writer.PageNumber.ToString(CultureInfo.InvariantCulture)); | |
Bookmarks.Add(new Bookmark(chapterTitle, _writer.PageNumber)); | |
_document.Add(paragraph); | |
_table = new PdfPTable(4); | |
_table.SpacingBefore = 10f; | |
_table.WidthPercentage = 100; | |
_table.DefaultCell.BorderColor = _headerColor; | |
_table.DefaultCell.BorderWidth = 100; | |
_table.DefaultCell.Padding = 100; | |
_table.SetWidths(new[] { 18f, 35f, 35f, 12f }); | |
_table.DefaultCell.VerticalAlignment = Element.ALIGN_TOP; | |
WriteTableHeader(); | |
foreach (var grouping in workItems.OrderBy(x => x.Area).GroupBy(x => x.Area)) | |
{ | |
foreach (var workItem in grouping.OrderBy(x => x.WorkItemId)) | |
{ | |
WriteTableRow(workItem); | |
} | |
} | |
_document.Add(_table); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment