Report > Report Assembly Interfaces > IPrxChart > IPrxChart.Slice
Slice : IPrxSlice;
The Slice property determines the slice to be used as a data source for a chart.
To use the slice as a data source, set the IPrxChart.SourceType property to Slice.
Executing the example requires that the repository contains a regular report with the REPORT identifier that contains a chart. A cube with the CUBE identifier is used as a data source for report.
Add links to the Chart, Metabase, Report, Tab system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Report: IPrxReport;
Table: IPrxTable;
TabObj: ITabObject;
Chart: IPrxChart;
Source: IPrxDataSource;
Slices: IPrxSlices;
Begin
// Get the current repository
MB := MetabaseClass.Active;
// Get regular report
Report := MB.ItemById("OBJ379455_COPY1").Edit As IPrxReport;
// Get chart
Table := Report.ActiveSheet As IPrxTable;
TabObj := Table.TabSheet.Objects.Item(0);
Chart := TabObj.Extension As IPrxChart;
// Specify source data for chart
Source := Report.DataSources.FindById("CUBE_SEP");
Slices := Source.Slices;
Slices.Clear;
Slices.Add;
Chart.Sheet := Report.Sheets.FindByName("Sheet1");
Chart.SourceType := PrxChartSourceType.Slice;
Chart.Slice := Source.Slices.FindByName("Slice");
// Save report
(Report As IMetabaseObject).Save;
End Sub UserProc;
After executing the example the slice is used as a data source of the chart.
See also: