Пример #1
0
 public static void AddRow(this PdfPTable t, string s, Font bfont)
 {
     t.AddCell("");
     t.CompleteRow();
     var c = new PdfPCell(t.DefaultCell);
     c.Border = PdfPCell.TOP_BORDER;
     c.BorderColorTop = BaseColor.BLACK;
     c.BorderWidthTop = 2.0f;
     c.Colspan = t.NumberOfColumns;
     c.AddElement(new Paragraph(s, bfont));
     c.GrayFill = .8f;
     t.AddCell(c);
     c.MinimumHeight = t.DefaultCell.MinimumHeight;
 }
        /// <summary>
        /// Adds the member.
        /// </summary>
        /// <param name="factory">The factory.</param>
        /// <param name="ticket">The ticket.</param>
        /// <param name="ticketHelper">The ticket helper.</param>
        /// <returns>BetListExcelBuilder object.</returns>
        public static BetListExcelBuilder AddUsername(this BetListExcelBuilder factory, ITicket ticket, ITicketHelper ticketHelper)
        {
            IRichTextString rtfMember = new HSSFRichTextString(ticket.UserName);
            factory.AddCell(rtfMember, ticketHelper.Index % 2 == 0 ? factory.OddCellStyleCenterAligned : factory.EvenCellStyleCenterAligned);

            return factory;
        }
Пример #3
0
 public static void AddPlainRow(this PdfPTable t, string s, Font bfont)
 {
     var c = new PdfPCell(t.DefaultCell);
     c.Border = PdfPCell.NO_BORDER;
     c.Colspan = t.NumberOfColumns;
     c.AddElement(new Phrase(s, bfont));
     t.AddCell(c);
 }
Пример #4
0
 public static void AddRight(this PdfPTable t, string s, Font font)
 {
     var c = new PdfPCell(new Paragraph(s, font));
     c.Border = t.DefaultCell.Border;
     c.BackgroundColor = t.DefaultCell.BackgroundColor;
     c.SetLeading(t.DefaultCell.Leading, 1f);
     c.HorizontalAlignment = Element.ALIGN_RIGHT;
     t.AddCell(c);
 }
Пример #5
0
 public static void AddHeader(this PdfPTable t, string s, Font font)
 {
     var c = new PdfPCell(new Paragraph(s, font));
     c.Border = PdfPCell.BOTTOM_BORDER;
     c.BackgroundColor = t.DefaultCell.BackgroundColor;
     c.MinimumHeight = t.DefaultCell.MinimumHeight;
     c.SetLeading(t.DefaultCell.Leading, 1f);
     t.AddCell(c);
 }
Пример #6
0
 public static void AddCentered(this PdfPTable t, string s, int colspan, Font font)
 {
     var c = new PdfPCell(new Paragraph(s, font));
     c.Border = t.DefaultCell.Border;
     c.BackgroundColor = t.DefaultCell.BackgroundColor;
     c.SetLeading(t.DefaultCell.Leading, 1f);
     c.Colspan = colspan;
     c.HorizontalAlignment = Element.ALIGN_CENTER;
     t.AddCell(c);
 }
Пример #7
0
 public static void Add(this PdfPTable t, string s, int colspan, Font font)
 {
     var c = new PdfPCell(new Paragraph(s, font));
     c.Border = t.DefaultCell.Border;
     c.BackgroundColor = t.DefaultCell.BackgroundColor;
     c.SetLeading(t.DefaultCell.Leading, 1f);
     c.Colspan = colspan;
     c.AddElement(new Paragraph(s, font));
     t.AddCell(c);
 }
Пример #8
0
 /// <summary>
 /// Adds a SummaryRow to an existing PdfGrid
 /// </summary>
 /// <param name="table">An existing PdfGrid</param>
 /// <param name="pdfColumnsDefinitions">List of the PdfColumnAttributes</param>
 /// <param name="summaryProperty">Sets the location of summary cell's data</param>
 /// <param name="labelProperty">Sets the location of summary cell's label</param>
 /// <param name="summaryCell">SummaryCell's Attributes</param>
 /// <param name="labelCell">LabelCell's Attributes</param>
 /// <param name="emptyCell">The other not in use cell's Attributes</param>
 /// <param name="itemsTemplate">Default ItemsTemplate</param>         
 public static void AddSummaryRow(this PdfGrid table,
                                  IList<ColumnAttributes> pdfColumnsDefinitions,
                                  string summaryProperty,
                                  string labelProperty,
                                  CellAttributes summaryCell,
                                  CellAttributes labelCell,
                                  CellAttributes emptyCell,
                                  IColumnItemsTemplate itemsTemplate)
 {
     foreach (var col in pdfColumnsDefinitions)
     {
         if (col.PropertyName == summaryProperty)
         {
             table.AddCell(summaryCell.CreateSafePdfPCell(itemsTemplate));
         }
         else if (col.PropertyName == labelProperty)
         {
             table.AddCell(labelCell.CreateSafePdfPCell(itemsTemplate));
         }
         else
         {
             table.AddCell(emptyCell.CreateSafePdfPCell(itemsTemplate));
         }
     }
 }
 /// <summary>
 /// Adds the no.
 /// </summary>
 /// <param name="factory">The factory.</param>
 /// <param name="index">The index.</param>
 /// <returns>BetListExcelBuilder object.</returns>
 public static BetListExcelBuilder AddNo(this BetListExcelBuilder factory, int index)
 {
     IRichTextString rtfNo = new HSSFRichTextString(index.ToString());
     factory.AddCell(rtfNo);
     return factory;
 }