Adjust;
Adjust();
The Adjust method automatically adjusts cell size.
The method adjusts cell size according to the parameters specified in AdjustSettings. The value of the IEaxGridAdjustSettings.AllowAdjust property is ignored.
Executing the example requires a form containing the UiReport component named UiReport1, the ReportBox component, for which UiReport is specified as a data source, and a button named Button1. In the regular report that is connected to Uireport1, a data source is added, and an analytical data area is based on it.
Add links to the Express, Report system assemblies.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Report: IPrxReport;
Grid: IEaxGrid;
AdjustSettings: IEaxGridAdjustSettings;
Begin
Report := UiReport1.Report;
Grid := Report.DataArea.Views.Item(0) As IEaxGrid;
AdjustSettings := Grid.AdjustSettings;
//Disable cell size autofit
AdjustSettings.AllowAdjust := False;
//...
//Some operations with Grid
//...
//Refresh table
Grid.Refresh;
//...
AdjustSettings.Mode := EaxAdjustMode.Columns;
//Autofit column size
Grid.Adjust;
End Sub Button1OnClick;
Imports Prognoz.Platform.Interop.Express;
Imports Prognoz.Platform.Interop.Report;
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
Report: IPrxReport;
Grid: IEaxGrid;
AdjustSettings: IEaxGridAdjustSettings;
Begin
Report := UiReportNet1.ReportUi.Report;
Grid := Report.DataArea.Views.Item[0] As IEaxGrid;
AdjustSettings := Grid.AdjustSettings;
//Disable cell size autofit
AdjustSettings.AllowAdjust := False;
//...
//Some operations with Grid
//...
//Refresh table
Grid.Refresh();
//...
AdjustSettings.Mode := EaxAdjustMode.eamColumns;
//Autofit column size
Grid.Adjust();
End Sub;
Clicking the button outputs analytical data area table. Cell size autofit is disabled in table settings, after which some other table settings can be made. On table refresh, cell size autofit is not executed, it will be executed later on calling the Adjust method.
See also: