To change format in measure:
procedure ex_ChangeDisplayFormatOfMeasureAmount;
var AIndex: integer;
begin
AIndex := fcSlice.FieldsOfRegion(rf_CapFacts).IndexOf('Measure_1');
if AIndex >= 0 then
begin
fcSlice.BeginUpdate;
fcSlice.CapFactsFieldsAbs[AIndex].VisibleInData := True;
fcSlice.CapFactsFieldsAbs[AIndex].DisplayFormat.Kind := fkNumeric;
To change format in measure:
procedure ex_ChangeDateFormatInDimentions;
var AIndex : integer;
begin
AIndex := 0;
if fcSlice.SliceFields.Find('Date', AIndex) then
begin
fcSlice.BeginUpdate;
fcSlice.SliceFields[AIndex].CubeField.DisplayFormat.FormatStr := 'mmm/dd'
fcSlice.EndUpdate;
end;
end;
Comments
Examples:
To change format in measure:
procedure ex_ChangeDisplayFormatOfMeasureAmount;
var AIndex: integer;
begin
AIndex := fcSlice.FieldsOfRegion(rf_CapFacts).IndexOf('Measure_1');
if AIndex >= 0 then
begin
fcSlice.BeginUpdate;
fcSlice.CapFactsFieldsAbs[AIndex].VisibleInData := True;
fcSlice.CapFactsFieldsAbs[AIndex].DisplayFormat.Kind := fkNumeric;
fcSlice.CapFactsFieldsAbs[AIndex].DisplayFormat.FormatStr := '%2.2n';
fcSlice.EndUpdate;
end
end;
To change format in measure:
procedure ex_ChangeDateFormatInDimentions;
var AIndex : integer;
begin
AIndex := 0;
if fcSlice.SliceFields.Find('Date', AIndex) then
begin
fcSlice.BeginUpdate;
fcSlice.SliceFields[AIndex].CubeField.DisplayFormat.FormatStr := 'mmm/dd'
fcSlice.EndUpdate;
end;
end;
Also You can change default formats in TfcCube.
Also see See compiled demo "FastCube examples".
Oleg.