AdjustMode: PrxAdjustMode;
The AdjustMode property determines cell size autofit method.
Sub Main;
Var
MB: IMetabase;
MObj : IMetabaseObject;
Report : IPrxReport;
TabIs : IPrxTableIslands;
TI : IPrxTableIsland;
Range : ITabRange;
Layout : IPrxTableIslandLayout;
Row : IPrxTableIslandLayoutRow;
Cell : IPrxTableIslandLayoutCell;
Begin
MB := MetabaseClass.Active;
MObj := MB.ItemById("Report").Edit;
Report := MObj As IPrxReport;
TabIs := Report.TableIslands;
TI := TabIs.Add;
TI.Source := Report.TableSources.Item(0);
TI.Sheet := Report.Sheets.Item(0);
TI.AdjustMode := PrxAdjustMode.Columns; // adjust mode - columns only
Range := (TI.Sheet As IPrxTable).TabSheet.Cell(1,1);
TI.Range := Range;
Layout := TI.Layout;
Row := Layout.Add;
Row.Height := 30;
Cell := Row.Add;
Cell.Field.FieldName := "ID";
Cell := Row.Add;
Cell.Field.FieldName := "NAME";
TI.Save;
MObj.Save;
End Sub Main;
After executing the example a relational data area with the specified parameters is added into the sheet of the regular report. Report - an identifier of a regular report.
See also: