DataSource: IPrxDataSource;
The DataSource property returns the data source containing the slice used as a data source for the specified cell.
Executing the example requires that the repository contains a regular report with the REPORT identifier that contains a data area linked to the B1 cell.
Add links to the Metabase, Report and Tab system assemblies.
Sub UserProc;
Var
MB: IMetabase;
MObj: IMetabaseObject;
Report: IPrxReport;
Sheet: IPrxSheet;
Drill: IPrxDrillCellResult;
SheetTab: IPrxTable;
Data: IPrxTableDataBinding;
Source: IPrxDataSource;
Begin
MB := MetabaseClass.Active;
// Get regular report
MObj := MB.ItemById("REPORT").Edit;
Report := MObj As IPrxReport;
// Get active report sheet
Sheet := Report.ActiveSheet;
Sheet.Recalc;
SheetTab := Sheet As IPrxTable;
// Get information about B1 cell link to data slice
Data := SheetTab.DataBinding;
Drill := Data.DrillCell(1,1);
// Display data source name in the console
Source := Drill.DataSource;
Debug.WriteLine(Source.Name);
End Sub UserProc;
After executing the example the console displays the data source name of the slice linked to the B1 cell.
See also: