本文整理汇总了C#中Layout.GetColumnWidths方法的典型用法代码示例。如果您正苦于以下问题:C# Layout.GetColumnWidths方法的具体用法?C# Layout.GetColumnWidths怎么用?C# Layout.GetColumnWidths使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Layout
的用法示例。
在下文中一共展示了Layout.GetColumnWidths方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReportPdf
public ReportPdf(Stream Output, Layout Layout, Template Template, Dictionary<string, string> ConfigParams)
: base(Output, Layout, Template, ConfigParams)
{
Rectangle pageSize = new Rectangle(mm2pt(Template.PageSize.Width), mm2pt(Template.PageSize.Height));
// Initialization
m_Document = new Document(pageSize, mm2pt(Template.Margin.Left), mm2pt(Template.Margin.Right), mm2pt(Template.Margin.Top), mm2pt(Template.Margin.Bottom));
m_Writer = PdfWriter.GetInstance(m_Document, Output);
m_Document.AddCreationDate();
m_Document.AddCreator("StrengthReport http://dev.progterv.info/strengthreport) and KeePass (http://keepass.info)");
m_Document.AddKeywords("report");
m_Document.AddTitle(Layout.Title+" (report)");
// Header
HeaderFooter header = new HeaderFooter(new Phrase(Layout.Title+", "+DateTime.Now.ToString(), m_Template.ReportFooter.getFont()), false);
header.Alignment = Template.ReportFooter.getAlignment();
m_Document.Header = header;
// Footer
HeaderFooter footer = new HeaderFooter(new Phrase(new Chunk("Page ", m_Template.ReportFooter.getFont())), new Phrase(new Chunk(".", m_Template.ReportFooter.getFont())));
footer.Alignment = Template.ReportFooter.getAlignment();
m_Document.Footer = footer;
// TODO: Metadata
// Open document
m_Document.Open();
// Report Heading
{
PdfPTable reportTitle = new PdfPTable(1);
PdfPCell titleCell = new PdfPCell(new Phrase(Layout.Title, m_Template.ReportHeader.getFont()));
titleCell.Border = 0;
titleCell.FixedHeight = mm2pt(m_Template.ReportHeader.Height);
titleCell.VerticalAlignment = Element.ALIGN_MIDDLE;
titleCell.HorizontalAlignment = m_Template.ReportHeader.getAlignment();
reportTitle.AddCell(titleCell);
reportTitle.WidthPercentage = 100;
m_Document.Add(reportTitle);
}
// Create main table
m_Table = new PdfPTable(Layout.GetColumnWidths());
m_Table.WidthPercentage = 100;
m_Table.HeaderRows = 1;
foreach (LayoutElement element in Layout) {
PdfPCell cell = new PdfPCell(new Phrase(element.Title, m_Template.Header.getFont()));
cell.BackgroundColor = m_Template.Header.Background.ToColor();
cell.MinimumHeight = mm2pt(m_Template.Header.Height);
cell.VerticalAlignment = Element.ALIGN_MIDDLE;
m_Table.AddCell(cell);
}
m_colorRow = new CMYKColor[] { m_Template.Row.BackgroundA.ToColor(), m_Template.Row.BackgroundB.ToColor() };
}