IAdmReportChartItemValueCalculator

The IAdmReportChartItemValueCalculator interface is used to generate values for report chart items.

Inheritance: IUnknown

Methods

Properties

  • Property

  • Description

  • Column

  • Gets or sets the column, values of which are calculated in the report chart item.

  • Type

  • Gets or sets a value indicating how to calculate the value of the report chart item.

  • SpecificValue

  • Gets or sets a value to count.

  • SpecificValueMask

  • Gets or sets a bitmask that determines which bits of the value specified in the Column property are counted.

  • SpecificValueLogicalOperator

  • Gets or sets the logical operator that determines how to calculate values if SpecificValueMask is set.

  • MinValue

  • Gets or sets the minimum value for the range of values to be calculated.

  • MaxValue

  • Gets or sets the maximum value in the range of values to be calculated.

Details

CalculateValue()

Returns a value for a report chart item.

int CalculateValue(IAdmSearchResult[] items, 
                   IAdmReportArguments arguments, 
                   IAdmExecutionLogEntryCollection log)

Parameters

  • items - Specifies an array of search results that contain values for the column specified in the Column property.
  • arguments - Specifies arguments for report generation.
  • log - Specifies the log of errors, warnings, and informational messages associated with calculating the value.

Remarks

The method returns -1 if the calculated value is outside the range of the int type.


Column

Gets or sets the column, values of which are calculated in the report chart item.

  • Type:
  • Object
  • Access:
  • Read/Write

Remarks

If a column represents a directory property, the property name defined in your directory schema must be used to identify the column. Custom columns must be represented by the IAdmReportCustomColumn interface.


Type

Gets or sets a value indicating how to calculate the value of the report chart item.


SpecificValue

Gets or sets a value to count. You can use value references in the value (e.g. %department%). Value references are replaced with corresponding property values of the user, for which a report is generated.

  • Type:
  • Object
  • Access:
  • Read/Write

Remarks

This property takes effect only if the Type property is set to ADM_REPORTCHARTITEMCALCULATORTYPE_SPECFICVALUECOUNT.


SpecificValueMask

Gets or sets a bitmask that determines which bits of the value specified in the Column property are counted.

  • Type:
  • int
  • Access:
  • Read/Write

Examples

The following code sample creates a chart item that calculates the number of Security Global groups in a report.

PowerShell
# The $chart variable represents a report chart

$item = $chart.CreateItem()
[Softerra.Adaxes.Interop.Adsi.ADS_GROUP_TYPE_ENUM]$groupType =
    "ADS_GROUP_TYPE_GLOBAL_GROUP, ADS_GROUP_TYPE_SECURITY_ENABLED"

$item.Label = "MyItem"
$item.ValueCalculator.Column = "groupType"
$item.ValueCalculator.Type = "ADM_REPORTCHARTITEMCALCULATORTYPE_SPECFICVALUECOUNT"
$item.ValueCalculator.SpecificValueLogicalOperator = "ADM_LOGICALOPERATION_AND"
$item.ValueCalculator.SpecificValueMask = [int]$groupType
$item.ValueCalculator.SpecificValue  = [int]$groupType

$chart.Items = @($item)
C#
// The chart variable represents a report chart

IAdmReportChartItem item = chart.CreateItem();
ADS_GROUP_TYPE_ENUM groupType = ADS_GROUP_TYPE_ENUM.ADS_GROUP_TYPE_GLOBAL_GROUP | 
    ADS_GROUP_TYPE_ENUM.ADS_GROUP_TYPE_SECURITY_ENABLED;

item.Label = "MyItem";
item.ValueCalculator.Column = "groupType";
item.ValueCalculator.Type = 
    ADM_REPORTCHARTITEMCALCULATORTYPE_ENUM.ADM_REPORTCHARTITEMCALCULATORTYPE_SPECFICVALUECOUNT;
item.ValueCalculator.SpecificValueLogicalOperator = 
    ADM_LOGICALOPERATION_ENUM.ADM_LOGICALOPERATION_AND;
item.ValueCalculator.SpecificValueMask = (int)groupType;
item.ValueCalculator.SpecificValue = (int)groupType;

chart.Items = new IAdmReportChartItem[] {item};

SpecificValueLogicalOperator

Gets or sets the logical operator that determines how to calculate values when SpecificValueMask is set. If AND, all the bits specified by the mask must match. If OR, at least one of the bits must match.


MinValue

Gets or sets the minimum value for the range of values to be calculated. You can use value references in the value (e.g. %accountExpires%). Value references are replaced with corresponding property values of the user, for which a report is generated.

  • Type:
  • Object
  • Access:
  • Read/Write

Remarks

This property takes effect only if the Type property is set to ADM_REPORTCHARTITEMCALCULATORTYPE_RANGE. Set the property to null for the range to have no minimum restriction.


MaxValue

Gets or sets the maximum value in the range of values to be calculated. You can use value references in the value (e.g. %accountExpires%). Value references are replaced with corresponding property values of the user, for which a report is generated.

  • Type:
  • Object
  • Access:
  • Read/Write

Remarks

This property takes effect only if the Type property is set to ADM_REPORTCHARTITEMCALCULATORTYPE_RANGE. Set the property to null for the range to have no maximum restriction.


Requirements

Minimum required version: 2018.1

See also