PdfRpt.Core.Helper.TableHelper.AddSummaryRow C# (CSharp) Method

AddSummaryRow() public static method

Adds a SummaryRow to an existing PdfGrid
public static AddSummaryRow ( this table, IList pdfColumnsDefinitions, string summaryProperty, string labelProperty, PdfRpt.Core.Contracts.CellAttributes summaryCell, PdfRpt.Core.Contracts.CellAttributes labelCell, PdfRpt.Core.Contracts.CellAttributes emptyCell, IColumnItemsTemplate itemsTemplate ) : void
table this An existing PdfGrid
pdfColumnsDefinitions IList List of the PdfColumnAttributes
summaryProperty string Sets the location of summary cell's data
labelProperty string Sets the location of summary cell's label
summaryCell PdfRpt.Core.Contracts.CellAttributes SummaryCell's Attributes
labelCell PdfRpt.Core.Contracts.CellAttributes LabelCell's Attributes
emptyCell PdfRpt.Core.Contracts.CellAttributes The other not in use cell's Attributes
itemsTemplate IColumnItemsTemplate Default ItemsTemplate
return void
        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));
                }
            }
        }