2
我能夠使用Microsoft.Office.Interop.Excel.PivotFields屬性在透視字段上應用NumberFormat。但是這不會將相同的格式應用於總結字段。是否有數據透視表中的所有字段的單獨屬性,我缺少?在透視字段上應用數字格式
Microsoft.Office.Interop.Excel.PivotFields pFields = pivotTable.PivotFields();
foreach (Microsoft.Office.Interop.Excel.PivotField pf in pFields)
if (pf.DataType == XlPivotFieldDataType.xlNumber)
pf.NumberFormat = "#,##0.00";
是否有一個原因,您不能設置數據透視表上創建數據透視表/列/行上的數字格式? – 2013-03-29 12:44:37