Click or drag to resize

PdfTableAddRows Method

Add row data to the table. Pass an enumerator for a collection of items. Can also be an enumerator of a List<Dictionary<string,string>> object.

Namespace:  Atalasoft.PdfDoc.Generating.Shapes
Assembly:  Atalasoft.PdfDoc (in Atalasoft.PdfDoc.dll) Version: 11.4.0.9.0.377 (.NET 4.5.2, x86)
Syntax
public void AddRows(
	IEnumerator en
)

Parameters

en
Type: System.CollectionsIEnumerator
An enumerator for the data collection
Examples
List<Product> productList = CreateProductList();
productTable.AddRows(productList.GetEnumerator());

//Or

Dictionary<string, string> productData = new Dictionary<string, string>();
productData.Add("Name", productName);
productData.Add("SKU", productSku);
productData.Add("Quantity", quantity.ToString());
productData.Add("UnitPrice", unitPrice.ToString("C", CultureInfo.CurrentCulture));
productData.Add("CreatedDate", createdDate.ToString("d"));
productData.Add("TotalPrice", (quantity * unitPrice).ToString("C", CultureInfo.CurrentCulture));
List<Dictionary<string, string>> productList = new List<Dictionary<string, string>>();
productList.add(productData);
productTable.AddRows(productList.GetEnumerator());
See Also