i use code like this:
proc ButtonClick;
begin
ibQuery.close;
PCube.Dimensions.Clear;
ibQuery.FieldDefs.Clear;
...
ibQuery.sql.text:=ibQuery.sql.text+'name_comp,';//Dynamic add field to query
if ibQuery.Fields.FindField('NAME_COMP') = nil then
begin
ibQuery.FieldDefs.Add('NAME_COMP', ftString);
fFieldDef := ibQuery.FieldDefs.Find('NAME_COMP');
fField := fFieldDef.CreateField(ibQuery);
fField.FieldName := 'NAME_COMP';
fField.Name := 'NAME_COMP';fField.FieldKind:= fkData;fField.Size:=255;
DM:=TDimensionItem.Create(pc.Dimensions);
dm.DataSet:=ibQuery;
DM.FieldName:='NAME_COMP';
DM.AliasName:='NAME_COMP';
DM.DisplayName:='Company';DM.Enabled:=true;
map.DimensionToColumn('NAME_COMP',$00000003,PVCol.ItemCount-1);
map.RefreshData(true);
end;
//and some like [UP]
//THEN
ibNumDistr.SQL.Clear;ibNumDistr.SQL.Text:=query;
ibNumDistr.Active:=true;
ibNumDistr.Open;ibNumDistr.FetchAll; //I check this place - all fields and data i give
pcube.Active:=true;
and now i can see my dimension in PVDimToolBar
i want to move my Dimension to Column or row