How to set DisplayFormat in FC2

edited 12:04PM in FastCube 2
Hi,

in FastCube 1 it was possible to set the display format of measurefields this way:

fcxSlice1.CapFactsFieldsAbs[0].DisplayFormat.Kind := fkNumeric;
fcxSlice1.CapFactsFieldsAbs[0].DisplayFormat.FormatStr := '%2.2n';

What is the right way to do this in FC2?

Thanks.

Comments

  • edited 12:04PM
    Hello.

    Use fcxSlice1.MeasuresContainer.Measures[0].DisplayFormat property.

    Best regards,
    Paul Ishenin
  • edited 12:04PM
    wrote: »
    Hello.

    Use fcxSlice1.MeasuresContainer.Measures[0].DisplayFormat property.

    Best regards,
    Paul Ishenin

    Hello Paul,

    thank you for your answer.
    Sorry, but I'm still not able to solve this. In DisplayFormat there are no properties like Kind or FormatStr.
    Could you please explain more specific?

    Thanks

    Olaf
  • edited 12:04PM
    Hi.
    OlafH wrote: »
    Sorry, but I'm still not able to solve this. In DisplayFormat there are no properties like Kind or FormatStr.
    Could you please explain more specific?

    This properties in DisplayFormat.TypeFormat:
    DisplayFormat.TypeFormat.FormatStr
    DisplayFormat.TypeFormat.Kind

    Best regards,
    Oleg Pryalkov.
  • edited April 2015
    wrote:
    This properties in DisplayFormat.TypeFormat:
    DisplayFormat.TypeFormat.FormatStr
    DisplayFormat.TypeFormat.Kind

    Best regards,
    Oleg Pryalkov.
    Hi, sorry in FC 2.2.7, I set
      with fcxSlice.MeasuresContainer do begin
        i := AddCalcMeasure ('CustomA', CustomFactorDescr, af_Formula, 'CustomFactorA',
          'Result := Measures[''TotalFieldName''].CurrentValue * ' + CustomFactor.ToString);
     
        Measures[i].DisplayFormat.TypeFormat.Kind := fkCustom;
        Measures[i].DisplayFormat.TypeFormat.DecSeparator := ',';
        Measures[i].DisplayFormat.TypeFormat.FormatStr := '%2.2m';
        Measures[i].Width := CUBE_MEASURES_FIELD_WIDTH;
      end;
    

    The .Width setting works, but the DisplayFormat.TypeFormat settings have no effect. I tried fkNumeric and fkCustom. Any help would be appreciated, thank you.

Leave a Comment