Hi,
We have aspose setup creating loads of spread sheets and its all fine apart from the Sun fields for pivot tables. When the document is created, they appear without titles and the data on the page treats them like dodgy values.
Dropping them off and adding them in excel corrects the issue but Im not sure how or why they are doing this.
http://screencast.com/t/tw0qAFdXLFB
//Add Fields
foreach (ExcelPivotTableField field in this.Fields.OrderBy(f => f.Order))
{
var column = visibleColumns.FirstOrDefault(c => c.ColumnName == field.ColumnName);
int fieldIndex = visibleColumns.IndexOf(column);
// if this column doesn’t actually exist, skip adding it to the pivot table
if (fieldIndex == -1)
continue;
int holdField = pivotTable.AddFieldToArea(field.FieldType, fieldIndex);
PivotFieldCollection holdFields = pivotTable.Fields(field.FieldType);
var fieldInPivot = holdFields[holdField];
fieldInPivot.DisplayName = field.ColumnAlias;
if (field.FieldType == PivotFieldType.Data)
{
fieldInPivot.Function = field.AggregationType;
fieldInPivot.DisplayName = field.ColumnAlias;
}
I have tried settings the DisplayName and that does give it a value on screen but changes nothing about how the pivot table doesn’t seem to recognize it.