Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Get a handle on the SourceFields to use for building PivotTableFields later. SourceFields can be referenced by the column header name or by column index.

Code Block
SourceField prodSubCategory = pivot.SourceFields[0"ProductSubCategoryName"]; 
SourceField prodName = pivot.SourceFields[1"Product Name"];
SourceField sales = pivot.SourceFields[2"Sales"];
SourceField dateStart = pivot.SourceFields[3"Special Offer Start Date"];
SourceField dateEnd = pivot.SourceFields[4"Special Offer End Date"];
SourceField prodStdCost = pivot.SourceFields[5"Product Standard Cost"];
SourceField listPrice = pivot.SourceFields[6"Product List Price"];
SourceField discount = pivot.SourceFields[7"Special Offer Dicount"];
SourceField unitDiscountPrice = pivot.SourceFields[8"Unit Price with Discount"];
PageFields

To add a PageField, call CreateField on the PivotTable.PageFields collection. You will need to specify the SourceField that will be used to create the PageField.

...