IPrxMapDataAdapter.AdapterType

Fore Syntax

AdapterType: PrxMapAdapter;

Fore.NET Syntax

AdapterType: Prognoz.Platform.Interop.Report.PrxMapAdapter;

Description

The AdapterType property returns type of data adapter for the map.

Fore Example

Executing the example requires a table with data by some regions and a map with the Regions layer in a regular report with the REGULAR_REPORT identifier.

Add links to the Dimensions, Metabase, Report, Tab system assemblies.

Sub UserProc;
Var
    Mb: IMetabase;
    MObj: IMetabaseObject;
    Report: IPrxReport;
    Tab: ITabSheet;
    Map: IMap;
    BarVisual: IMapBarVisual;
    PrxDA: IPrxMapDataAdapter;
    Slice: IPrxSlice;
    MapDAdapt: IPrxMapDataAdapter;
    i, j: Integer;
Begin
    Mb := MetabaseClass.Active;
    MObj := Mb.ItemById(
"REGULAR_REPORT").Edit;
    Report := MObj 
As IPrxReport;
    Tab := (Report.ActiveSheet 
As IPrxTable).TabSheet;
    Map := Tab.Objects.Item(
0).Extension As IMap;
    MapDAdapt := Map.Layers.FindByName(
"Regions").TextDataAdapter As IPrxMapDataAdapter;
    i := MapDAdapt.AdapterType 
As Integer;
    
If i = 0 Then
       Debug.WriteLine(
" - Adapter type is not determined.");
    
Else If i = 1 Then
            Debug.WriteLine(
" - Static adapter type.");
         
Else If i = 2 Then
                 Debug.WriteLine(
" - Dynamic adapter type.");
              
Else If i = 3 Then
                      Debug.WriteLine(
" - Layer area adapter.");
                   
Else If i = 4 Then
                           Debug.WriteLine(
" - Territory info adapter.");
                        
End If;
                   
End If;
              
End If;
         
End If;
    
End If;
    j := MapDAdapt.AdapterDataType 
As Integer;
    
If j = 0 Then
       Debug.WriteLine(
" - Data source is not determined.");
    
Else If j = 1 Then
            Debug.WriteLine(
" - Data is taken from slice.");
         
Else If j = 2 Then
                 Debug.WriteLine(
" - Data is taken from specified value range.");
              
End If;
         
End If;
    
End If;
End Sub UserProc;

The console window displays adapter type and map source data source.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Map;
Imports Prognoz.Platform.Interop.Report;
Imports Prognoz.Platform.Interop.Tab;
Imports Prognoz.Platform.Interop.Dimensions;

Public Shared Sub Main(Params: StartParams);
Var
    Mb: IMetabase;
    MObj: IMetabaseObject;
    Report: IPrxReport;
    Tab: ITabSheet;
    Map: IMap;
    BarVisual: IMapBarVisual;
    PrxDA: IPrxMapDataAdapter;
    Slice: IPrxSlice;
    MapDAdapt: IPrxMapDataAdapter;
    i, j: Integer;
Begin
    Mb := Params.Metabase;
    MObj := Mb.ItemById["REGULAR_REPORT"].Edit();
    Report := MObj As IPrxReport;
    Tab := (Report.ActiveSheet As IPrxTable).TabSheet;
    Map := Tab.Objects.Item[0].Extension As IMap;
    MapDAdapt := Map.Layers.FindByName["Regions"].TextDataAdapter As IPrxMapDataAdapter;
    i := MapDAdapt.AdapterType As Integer;
    If i = 0 Then
       System.Diagnostics.Debug.WriteLine(" - Adapter type is not determined.");
    Else If i = 1 Then
           System.Diagnostics.Debug.WriteLine(" - Static adapter type.");
         Else If i = 2 Then
                 System.Diagnostics.Debug.WriteLine(" - Dynamic adapter type.");
              Else If i = 3 Then
                      System.Diagnostics.Debug.WriteLine(" - Layer area adapter.");
                   Else If i = 4 Then
                           System.Diagnostics.Debug.WriteLine(" - Territory info adapter.");
                        End If;
                   End If;
              End If;
         End If;
    End If;
    j := MapDAdapt.AdapterDataType As Integer;
    If j = 0 Then
       System.Diagnostics.Debug.WriteLine(" - Data source is not determined.");
    Else If j = 1 Then
            System.Diagnostics.Debug.WriteLine(" - Data is taken from slice.");
         Else If j = 2 Then
                 System.Diagnostics.Debug.WriteLine(" - Data is taken from specified value range.");
              End If;
         End If;
    End If;
End Sub;

See also:

IPrxMapDataAdapter