To set up table appearance, the ITabView interface is used.
The example of table appearance setting in regular report with the REPORT_TAB identifier is given. The report contains analytical data area.
table before setting:
Table after setting:
Executing the example requires to add links to the Metabase, Report, Tab assemblies.
Sub TableView;
Var
mb: IMetabase;
Report: IPrxReport;
Table: ITabSheet;
View: ITabView;
Filter: ITabAutoFilter;
RCount: String;
Begin
// Get current repository
mb := MetabaseClass.Active;
// Get regular report
Report := mb.ItemById("REPORT_TAB").Edit As IPrxReport;
// Get table
Table := (Report.ActiveSheet As IPrxTable).TabSheet;
// Get object which determine appearance of the table
View := Table.View;
// Create autofilter on column D
Filter := View.AutoFilter;
RCount := (Table.RowsCount - 1).ToString;
Filter.Range := Table.ParseRange("D0:D" + RCount);
Filter.Enabled := True;
// Increase width of the D column
Table.ColumnPixelWidth(3) := 75;
// Fix the first row and the first column
View.FixedColumnsCount := 1;
View.FixedRowsCount := 1;
// Change height and width of columns header
View.ColumnsHeaderHeight := 8;
View.RowsHeaderWidth := 8;
// Disable gridline layout
View.DisplayGrid := False;
// Save changes
(Report As IMetabaseObject).Save;
End Sub TableView;
See also: