IMapScale.AutoCalculate

Syntax

AutoCalculate(Layer: IMapLayer; DataAdapter: Object; AttributeName: String);

Parameters

Layer - map layer.

DataAdapter - a cube value that corresponds to the territory with the specified attribute.

AttributeName - map attribute.

Description

The AutoCalculate method automatically calculates report scale values.

Example

The example requires the Report object of the IPrxReport type. A color scale needs to be created for the regular report, the report sheet must contain the map, for which the map indicator is created.

Sub UserProc;

Var

Report: IPrxReport;

Map : IMap;

Layer :  IMapLayer;

Visual: IMapAreaVisual;

MapScale : IMapColorScale;

Begin

Map := (Report.ActiveSheet As IPrxTable).TabSheet.Objects.Item(0).Extension As IMap;

Layer := Map.Layers.FindByName("Regions");

Visual := Layer.Visuals.Item(0) As IMapAreaVisual;

MapScale := Report.Scales.Item(0).MapScale As IMapColorScale;

MapScale.AutoCalculable := True;

MapScale.AutoScaleMode := MapAutoScaleMode.Uniform;   

MapScale.AutoCalculate(Layer, Visual.DataAdapter, Visual.AttributeName);

End Sub UserProc;

After executing the example the values are calculated for the report scale.

See also:

IMapScale