Class MeasureField
Namespace: FastReport.Olap.Slice
Assembly: FastCube.Core.dll
Measure field
public class MeasureField : ContainerField
Inheritance
object ← ContainerField ← MeasureField
Inherited Members
ContainerField.alignment, ContainerField.bindCaptionWidth, ContainerField.caption, ContainerField.captionWidth, ContainerField.container, ContainerField.name, ContainerField.Alignment, ContainerField.BindCaptionWidth, ContainerField.Caption, ContainerField.CaptionWidth, ContainerField.DisplayFormat, ContainerField.Index, ContainerField.Name, ContainerField.Width, ContainerField.BeginUpdate(), ContainerField.EndUpdate(), ContainerField.Load(XmlItem, int), ContainerField.Save(XmlItem), ContainerField.FullRebuildChanged(), ContainerField.FullRedrawChanged(), ContainerField.LightRedrawChanged()
Constructors
MeasureField(Slice)
Don't use this contructor in code. For internal use only.
public MeasureField(Slice slice)
Parameters
slice
Slice
Reference to Slice
MeasureField(Slice, AggregateFunction, SliceField, SliceField, SliceField, string, string, bool)
Create new Measure
public MeasureField(Slice slice, AggregateFunction aggregateFunction, SliceField baseSliceField, SliceField distinctSliceField, SliceField extraSliceField, string name, string caption, bool distinct)
Parameters
slice
Slice
Reference to Slice
aggregateFunction
AggregateFunction
Aggregate function
baseSliceField
SliceField
Slice field which is used as base for aggregation
distinctSliceField
SliceField
Slice field which is used to distinct values
extraSliceField
SliceField
Additional slice field which is used for some aggregations (AggregateFunction.WeightedMean)
name
string
Field name
caption
string
Field caption
distinct
bool
Calculate for distinct values
MeasureField(Slice, AggregateFunction, SliceField)
Create new Measure
public MeasureField(Slice slice, AggregateFunction aggregateFunction, SliceField baseSliceField)
Parameters
slice
Slice
Reference to Slice
aggregateFunction
AggregateFunction
Aggregate function
baseSliceField
SliceField
Slice field which is used as base for aggregation
MeasureField(Slice, string, string, string)
Create measure field with Expression
public MeasureField(Slice slice, string expression, string name, string caption)
Parameters
slice
Slice
Reference to Slice
expression
string
Expression to run
name
string
Field name
caption
string
Field caption
Properties
AggregateFunction
Measure aggregate function (Sum, Count, ...)
public AggregateFunction AggregateFunction { get; set; }
Property Value
AggregateFunctionTotals
Total aggregate function (Sum, Count, ...)
public AggregateFunction AggregateFunctionTotals { get; set; }
Property Value
BaseSliceField
Slice field which is used for the Measure
public SliceField BaseSliceField { get; set; }
Property Value
CalcTotalsOnTotals
Defines whether to calculate totals using totals or using source records. E.g.: averge will differ if it use values from previously calculated avergate totals than source records values
public bool CalcTotalsOnTotals { get; set; }
Property Value
CalculateAllCells
Defines whether to calculate all cells or only those cells which have values in source records. Only for script aggregates.
public bool CalculateAllCells { get; set; }
Property Value
CalculateAllTotalCells
Defines whether to calculate total cells even if they are not going to be calculated according to cells. E.g. if all cells are empty then total cell is also going to be empty and if the property is False then engine will not call script to get total value. But if property is set to True the script will be executed.
public bool CalculateAllTotalCells { get; set; }
Property Value
CalculateEvent
Gets or sets a script method name that will be used to handle the FastReport.Olap.Slice.MeasureField.Calculate event.
public string CalculateEvent { get; set; }
Property Value
Remarks
See the FastReport.Olap.Slice.MeasureField.Calculate event for more details.
CalculateFilterEvent
Gets or sets a script method name that will be used to handle the FastReport.Olap.Slice.MeasureField.CalculateFilter event.
public string CalculateFilterEvent { get; set; }
Property Value
Remarks
See the FastReport.Olap.Slice.MeasureField.CalculateFilter event for more details.
CalculateTotalsEvent
Gets or sets a script method name that will be used to handle the FastReport.Olap.Slice.MeasureField.CalculateTotals event.
public string CalculateTotalsEvent { get; set; }
Property Value
Remarks
See the FastReport.Olap.Slice.MeasureField.CalculateTotals event for more details.
Calculated
Flag which indicates that Measure is calculated in script
public bool Calculated { get; }
Property Value
CalculatedTotals
Flag which indicates that Total is calculated in script
public bool CalculatedTotals { get; }
Property Value
ChangeNULLtoZero
Use 0 for null value
public bool ChangeNULLtoZero { get; set; }
Property Value
DisplayFormat
Gets or sets display format.
public override FormatBase DisplayFormat { get; set; }
Property Value
DisplayValueAs
Show values, percents and ranks
public DisplayValueAs DisplayValueAs { get; set; }
Property Value
Distinct
Whether to handle all values or only distinct values for measure value
public bool Distinct { get; set; }
Property Value
DistinctSliceField
If Distinct is set to True defines Slice field to check for distinct values
public SliceField DistinctSliceField { get; set; }
Property Value
DistinctTotals
Whether to handle all values or only distinct values for total value
public bool DistinctTotals { get; set; }
Property Value
Expression
Gets or sets an expression that calculates measure cell values.
public string Expression { get; set; }
Property Value
ExpressionFilter
Gets or sets an expression that calculates measure filter.
public string ExpressionFilter { get; set; }
Property Value
ExpressionTotals
Gets or sets an expression that calculates measure total values.
public string ExpressionTotals { get; set; }
Property Value
ExtendDisplayValueAsOnRow
Add rows or cols to show percents and ranks
public bool ExtendDisplayValueAsOnRow { get; set; }
Property Value
ExtraSliceField
Defines additional slice field for aggregates which requires 2 values. E.g. WeightedMean aggregate.
public SliceField ExtraSliceField { get; set; }
Property Value
Height
Height of the measure cell
public int Height { get; set; }
Property Value
Highlights
Reference to list of highlights set for the measure
public CustomHighlights Highlights { get; set; }
Property Value
MeasuresContainer
Reference to container
public MeasuresContainer MeasuresContainer { get; }
Property Value
ScriptOrder
Order of calculated aggregate amoung other calculated measures
public int ScriptOrder { get; set; }
Property Value
ScriptOrderTotals
Order of calculated total aggregate amoung other calculated totals
public int ScriptOrderTotals { get; set; }
Property Value
TotalConflictResolve
Gets or sets totals conflict resolve.
public TotalsConflictResolve TotalConflictResolve { get; set; }
Property Value
TotalPosition
Totals position of Measure
public TotalPosition TotalPosition { get; set; }
Property Value
UseDifferentAggregateFunctionForTotals
Defines whether to use the same aggregate function for regular and total cells or to use different aggregate function for totals
public bool UseDifferentAggregateFunctionForTotals { get; set; }
Property Value
UseXAxisTotalsAsBase
If we calculate totals using totals we need to decide which Axis to use for base totals If True - use X Axis, if False - Y Axis
public bool UseXAxisTotalsAsBase { get; set; }
Property Value
ValueType
Gets or sets type of value.
public Type ValueType { get; }
Property Value
Visible
Sets visibility of the Measure
public bool Visible { get; set; }
Property Value
Width
Width of the measure cell
public override int Width { get; set; }
Property Value
Methods
GetExpressions()
Gets all expressions contained in the object.
public Expression[] GetExpressions()
Returns
Array of expressions or null if object contains no expressions.
Remarks
Do not call this method directly.
This method is called by FastCube each time before building a slice. FastCube do this to collect all expressions and compile them.
InvokeEvent(string, object)
Invokes script event.
public void InvokeEvent(string name, object param)
Parameters
name
string
Name of the event to invoke.
param
object
Event parameters.
Remarks
Do not call this method directly. You should use it if you are developing a new aggregate function for FastCube.
Use this method to call an event handler that is located in the slice's script.
Load(XmlItem, int)
Load Measure settings from XML
public override void Load(XmlItem item, int version)
Parameters
item
XmlItem
Item to load settings from
version
int
Format version
OnCalculate(CalculateMeasureEventArgs)
This method fires the Calculate event and the script code connected to the CalculateEvent.
public void OnCalculate(CalculateMeasureEventArgs e)
Parameters
Event data.
OnCalculateFilter(CalculateFilterEventArgs)
This method fires the Calculate event and the script code connected to the CalculateEvent.
public void OnCalculateFilter(CalculateFilterEventArgs e)
Parameters
Event data.
OnCalculateTotals(CalculateMeasureEventArgs)
This method fires the CalculateTotals event and the script code connected to the CalculateTotalsEvent.
public void OnCalculateTotals(CalculateMeasureEventArgs e)
Parameters
Event data.
Save(XmlItem)
Save measure settings to XML
public override void Save(XmlItem item)
Parameters
item
XmlItem
XML item to store settings
Calculate
Allows to calculate cell value.
public event CalculateMeasureEventHandler Calculate
Event Type
CalculateFilter
Allows to set cell filtering.
public event CalculateFilterEventHandler CalculateFilter
Event Type
CalculateTotals
Allows to calculate total value.
public event CalculateMeasureEventHandler CalculateTotals