Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
from an empty PIVOT chart, i'm adding dimensions and expressions with a script through functions like that :
chart.AddDimension
chart.AddExpression
but how can i say that i want the dimensions to be seen on rows or colums ?
the user can drag the rows into columns but is it possible to do it in design time ?
Thanks
Check property NumberOfLeftDimensions
Sample from APIGUIDE
rem Create HLO system table on new sheet
set Sheet=ActiveDocument.CreateSheet
set Hlo=Sheet.CreatePivotTable
Hlo.AddDimension "$Field"
Hlo.AddDimension "$Table"
Hlo.AddExpression "Only([$Field])"
set Prop = Hlo.GetProperties
Prop.TableProperties.PivotAlwaysFullyExpanded=true
Prop.Dimensions.Item(0).SortCriteria.SortByAscii=0
Prop.Dimensions.Item(0).SortCriteria.SortByLoadOrder=1
Prop.Dimensions.Item(1).SortCriteria.SortByAscii=0
Prop.Dimensions.Item(1).SortCriteria.SortByLoadOrder=1
Prop.TableProperties.NumberOfLeftDimensions = 1
Hlo.SetProperties Prop
Check property NumberOfLeftDimensions
Sample from APIGUIDE
rem Create HLO system table on new sheet
set Sheet=ActiveDocument.CreateSheet
set Hlo=Sheet.CreatePivotTable
Hlo.AddDimension "$Field"
Hlo.AddDimension "$Table"
Hlo.AddExpression "Only([$Field])"
set Prop = Hlo.GetProperties
Prop.TableProperties.PivotAlwaysFullyExpanded=true
Prop.Dimensions.Item(0).SortCriteria.SortByAscii=0
Prop.Dimensions.Item(0).SortCriteria.SortByLoadOrder=1
Prop.Dimensions.Item(1).SortCriteria.SortByAscii=0
Prop.Dimensions.Item(1).SortCriteria.SortByLoadOrder=1
Prop.TableProperties.NumberOfLeftDimensions = 1
Hlo.SetProperties Prop
Excellent, thank you !