public static AddSummaryRow ( this table, IList |
||
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));
}
}
}