AdviseAdapter(Value: IPrxMapDataAdapter);
Value. Map data source.
The AdviseAdapter property informs map data adapter about changing data in the source. Adapter data is updated when the sheet of the regular report is calculated.
Executing the example requires a regular report with the REGULAR_REPORT identifier with a map (*.tbs) with source data on its sheet. Add links to the Metabase, Report, Tab, Map, Dimensions system assemblies in the unit.
Sub UserProc;
Var
Metabase: IMetabase;
Report: IPrxReport;
Tab: ITabSheet;
PrxMap: IPrxMap;
Map: IMap;
DtSources: IPrxDataSources;
Slices: IPrxSlices;
Slice: IPrxSlice;
DimInst: IDimInstance;
MapDAdapt: IPrxMapDataAdapter;
Visual: IMapVisual;
Begin
Metabase := MetabaseClass.Active;
Report := Metabase.ItemById("REGULAR_REPORT").Edit As IPrxReport;
Tab := (Report.ActiveSheet As IPrxTable).TabSheet;
PrxMap := Tab.Objects.Item(0).Extension As IPrxMap;
Map := PrxMap As IMap;
DtSources := Report.DataSources;
Slices := DtSources.Item(0).Slices;
Slice := Slices.Item(0);
MapDAdapt := Slice.CreateMapDataAdapter(PrxMapAdapter.Static);
DimInst := Slice.Dimensions.Item(0).Dimension;
MapDAdapt.Dimension := DimInst.Dimension;
MapDAdapt.Index := DimInst.Indexes.Item(0).Index;
Visual := Map.Layers.Item(0).Visuals.AddAreaVisual As IMapVisual;
Visual.AttributeName := "Id";
Visual.DataAdapter := MapDAdapt;
Visual.Name := "Map indicator";
PrxMap.AdviseAdapter(MapDAdapt);
Report.MetabaseObject.Save;
End Sub UserProc;
After executing the example a new map indicator is created for the regular report map. If the source contains changed data, it is updated in the map adapter when the sheet of the regular report is calculated.
See also: