### Upload Changed Planner Events to Database (Pascal) Source: https://www.ehlib.com/online-help/ehlib-vcl-11-1/EhLibDoc/31-components-for-planning-management/01-components-for-planning-and-event-management Provides an example of handling the OnApplyUpdateToDataStorage event in TPlannerDataSourceEh to persist modifications made to PlannerDataItem events back to a TMemTableEh (TDataSet). ```Pascal procedure TForm1.PlannerDataSourceEh1ApplyUpdateToDataStorage(Sender: TObject; PlanItem: TPlannerDataItemEh; UpdateStatus: TUpdateStatus); var TimePlanSource: TPlannerDataSourceEh; begin if UpdateStatus = usModified then begin if mtPlannerData.Locate('Id', PlanItem.ItemID, []) then begin mtPlannerData.Edit; mtPlannerData['StartTime'] := PlanItem.StartTime; mtPlannerData['EndTime'] := PlanItem.EndTime; mtPlannerData['Title'] := PlanItem.Title; mtPlannerData['Body'] := PlanItem.Body; mtPlannerData['AllDay'] := PlanItem.AllDay; mtPlannerData['ResourceID'] := PlanItem.ResourceID; mtPlannerData.Post; end else raise Exception.Create('Can'' locate record with "Id"=' + VarToStrDef(PlanItem.ItemID, '')); end; end; ``` -------------------------------- ### Example SQL for InterBase with Generator Source: https://www.ehlib.com/online-help/ehlib-vcl-11-1/EhLibDoc/29-tsqldatadrivereh-component/02-tsqldatadrivereh-component This example demonstrates an SQL INSERT statement for an InterBase server that utilizes the EMP_NO_GEN generator, as configured in the SpecParams property. ```SQL insert into employee (EMP_NO, FIRST_NAME) values (:EMP_NO_GEN, :FIRST_NAME) ``` -------------------------------- ### SQL Query with Filter Marker for Server Filtering Source: https://www.ehlib.com/online-help/ehlib-vcl-11-1/EhLibDoc/10-using-tdbgrideh-component/29-using-grid-for-sorting-and-filtering-data This example demonstrates how to structure a SQL query to enable server-side filtering with DBGridEh. The `/*Filter*/` marker is used to indicate where the filter expression should be inserted by the grid's special object. Ensure your SQL query includes this marker on a line that starts with it. ```sql select * from table1 where /*Filter*/ 1=1 ``` -------------------------------- ### Implement Custom Row Movement Logic in OnMoveRecords Event Source: https://www.ehlib.com/online-help/ehlib-vcl-11-1/EhLibDoc/10-using-tdbgrideh-component/15-move-rows-in-the-grid Provides an example of implementing custom logic within the OnMoveRecords event handler. This example demonstrates how to prevent specific records (where 'NODNAME' field is 'ROOT1') from being moved by checking the record's data and returning False. It also shows how to call the default row movement function when the conditions allow. ```Pascal function TForm1.DBGridEh1MoveRecords(Sender: TObject; BookmarkList: TBMListEh; ToRecNo, TreeLevel: Integer; CheckOnly: Boolean): Boolean; var Rec: TMemoryRecordEh; Name: String; begin if (CheckOnly = False) then // Check when the record is already trying to moved begin Rec := MemTableEh1.BookmarkToRec(BookmarkList.Items[0]); Name := VarToStr(Rec.DataValues['NODNAME', dvvValueEh]); if (Name = 'ROOT1') then begin ShowMessage(' ROOT1 cannot be moved'); Result := False; end else begin Result := DBGridEh1.DefaultMoveDataRows(BookmarkList, ToRecNo, TreeLevel, CheckOnly); end; end else begin Result := DBGridEh1.DefaultMoveDataRows(BookmarkList, ToRecNo, TreeLevel, CheckOnly); end; end; ``` -------------------------------- ### Implement Vertical Stack Panel with Text Blocks (Pascal) Source: https://www.ehlib.com/online-help/ehlib-vcl-11-1/EhLibDoc/10-using-tdbgrideh-component/52-complex-formatting-in-grid-cells-lacontrols Demonstrates the creation and configuration of a TLaStackPanelEh to arrange TLaTextBlockEh elements vertically. This example utilizes the 'with' statement and 'CreateWith' constructor for nested element creation. It shows how to set field names, margins, and static text with font styling. ```Pascal constructor TfrOneFishFacts.Create(AOwner: TComponent); var ALaControl: TLaObjectEh; begin inherited Create(AOwner); with TLaStackPanelEh.Create(Self) do begin Orientation := TLaOrientation.Vertical; with TLaTextBlockEh.CreateWith(Self, RefSelf) do begin FieldName := 'Species_Name'; Margins.SetBounds(10, 5, 5, 2); end; with TLaTextBlockEh.CreateWith(Self, RefSelf) do begin FieldName := 'Category'; Margins.SetBounds(10, 5, 5, 2); end; with TLaTextBlockEh.CreateWith(Self, RefSelf) do begin Text := 'Static Text'; Font.Style := [fsBold]; Margins.SetBounds(10, 5, 5, 2); end; ALaControl := RefSelf; end; DBGridEh1.Columns[0].LaControlTemplate := ALaControl; end; ``` -------------------------------- ### Example: Adding a 'Preview' Menu Item to IndicatorTitleMenu Source: https://www.ehlib.com/online-help/ehlib-vcl-11-1/EhLibDoc/10-using-tdbgrideh-component/42-using-global-properties-for-grid This Pascal code demonstrates how to add a custom 'Preview' menu item to the grid's indicator title menu. It involves declaring a global menu item, defining event handlers for menu building and item selection, and assigning the event handler in the form's OnCreate event. ```Pascal // Declare global menu item for printing the grid. var DBGridEhPreviewIndicatorMenuItem: TDBGridEhMenuItem; // In public section of main Form declare methods for // OnBuildIndicatorTitleMenu event. procedure BuildIndicatorTitleMenu(Grid: TCustomDBGridEh; var PopupMenu: TPopupMenu); // Event procedure that will be call when menu item is selected. procedure MenuEditClick(Sender: TObject); // In TMainForm.OnCreate event of the program, assign the event on that will // be form IndicatorTitle menu items. procedure TForm1.FormCreate(Sender: TObject); begin DBGridEhCenter.OnBuildIndicatorTitleMenu := BuildIndicatorTitleMenu; end; // Method Itself. procedure TForm1.BuildIndicatorTitleMenu(Grid: TCustomDBGridEh; var PopupMenu: TPopupMenu); begin // At first it calls the default method of menu building. DBGridEhCenter.DefaultBuildIndicatorTitleMenu(Grid, PopupMenu); // Then create new item. if DBGridEhPreviewIndicatorMenuItem = nil then DBGridEhPreviewIndicatorMenuItem := TDBGridEhMenuItem.Create(Screen); DBGridEhPreviewIndicatorMenuItem.Caption := 'Preview'; DBGridEhPreviewIndicatorMenuItem.OnClick := MenuEditClick; DBGridEhPreviewIndicatorMenuItem.Enabled := True; DBGridEhPreviewIndicatorMenuItem.Grid := Grid; // And add it at the end of the menu list. PopupMenu.Items.Insert( PopupMenu.Items.IndexOf(DBGridEhSelectAllIndicatorMenuItem)+1, DBGridEhPreviewIndicatorMenuItem); end; // The Handler of new menu item. procedure TForm1.MenuEditClick(Sender: TObject); begin PrintDBGridEh1.DBGridEh := TDBGridEh(TDBGridEhMenuItem(Sender).Grid); PrintDBGridEh1.SetSubstitutes(['%[Today]',DateToStr(Now)]); PrintDBGridEh1.Preview; end; ``` -------------------------------- ### Populate Worksheet Cells and Add Formulas (Pascal) Source: https://www.ehlib.com/online-help/ehlib-vcl-11-1/EhLibDoc/32-txlsmemfileeh/01-txlsmemfileeh-class Provides examples of filling cell values with data from a DBGridEh component and adding a SUM formula to a cell. It demonstrates accessing cells by their column and row index. ```Pascal Sheet.Cells[0, 3].Value := DBGridEh1.Columns[0].Title.Caption; Sheet.Cells[1, 3].Value := DBGridEh1.Columns[1].Title.Caption; Sheet.Cells[2, 3].Value := DBGridEh1.Columns[2].Title.Caption; ... Sheet.Cells[0, i + 4].Value := DBGridEh1.Columns[0].Field.Value; Sheet.Cells[1, i + 4].Value := DBGridEh1.Columns[1].Field.Value; Sheet.Cells[2, i + 4].Value := DBGridEh1.Columns[2].Field.Value; Sheet.Cells[1, i+4].Formula := 'SUM(E5:' + 'E' + IntToStr(i+4) + ')'; ``` -------------------------------- ### Create and Fill Data Source Table in EhLib Source: https://www.ehlib.com/online-help/ehlib-vcl-11-1/EhLibDoc/30-components-for-consolidated-data-analysis/02-description-of-components Creates and populates the internal buffer table of PivotDataSourceEh with data from its associated DataSet. This step is crucial for loading the data that will be analyzed and displayed in the PivotGridEh. ```pascal PivotDataSourceEh1.CreateAndFillSourceTable; ``` -------------------------------- ### Create Language-Specific Resource Files (DFM) Source: https://www.ehlib.com/online-help/ehlib-vcl-11-1/EhLibDoc/05-language-resources Example file names for language-specific resource files. By appending a language code (e.g., ENU, BGR) to the base DFM name, different language versions of the application strings can be managed. ```DFM AppLangConsts.ENU.dfm AppLangConsts.BGR.dfm AppLangConsts.CHS.dfm AppLangConsts.CSY.dfm AppLangConsts.DEU.dfm ``` -------------------------------- ### Apply Comprehensive Formatting to Cell Range in EhLib Source: https://www.ehlib.com/online-help/ehlib-vcl-11-1/EhLibDoc/32-txlsmemfileeh/07-formatting-cells-in-a-table This example shows how to apply various formatting options to a cell range, including borders, number format, alignment, and font properties. It retrieves font details from another component and applies them to the selected cells before saving changes. ```pascal cr := Sheet.GetCellsRange(0,4,6,i+4); cr.Border.Top.Style := clsMediumEh; cr.Border.Bottom.Style := clsMediumEh; cr.Border.Left.Style := clsMediumEh; cr.Border.Right.Style := clsMediumEh; cr.InsideBorder.Top.Style := clsThinEh; cr.InsideBorder.Bottom.Style := clsThinEh; cr.InsideBorder.Left.Style := clsThinEh; cr.InsideBorder.Right.Style := clsThinEh; cr.NumberFormat := '#,##0.0000'; cr.VertAlign := cvaCenterEh; cr.HorzAlign := chaCenterEh; AFont := DBVertGridEh1.VisibleFieldRow[i].Font; cr.Font.Name := AFont.Name; cr.Font.Size := AFont.Size; cr.Font.Color := AFont.Color; cr.Font.IsBold := fsBold in AFont.Style; cr.Font.IsItalic := fsItalic in AFont.Style; cr.Font.IsUnderline := fsUnderline in AFont.Style; cr.ApplyChages; ``` -------------------------------- ### Customize Planner Item Hint Window - Delphi Source: https://www.ehlib.com/online-help/ehlib-vcl-11-1/EhLibDoc/31-components-for-planning-management/03-show-hint-winow-for-planner-items This Delphi code example shows how to handle the `OnSpanItemHintShow` event to modify the hint window's text and font style. It adds a new line of text and sets the hint font to bold. The `PlannerControl.DefaultFillSpanItemHintShowParams` function is called to set default hint parameters before customization. ```Delphi procedure TfrFrameOne.PlannerDayViewEh1SpanItemHintShow( PlannerControl: TPlannerControlEh; PlannerView: TCustomPlannerViewEh; CursorPos: TPoint; SpanRect: TRect; InSpanCursorPos: TPoint; SpanItem: TTimeSpanDisplayItemEh; Params: TPlannerViewSpanHintParamsEh; var Processed: Boolean); begin PlannerControl.DefaultFillSpanItemHintShowParams(PlannerView, CursorPos, SpanRect, InSpanCursorPos, SpanItem, Params); Params.HintStr := Params.HintStr + sLineBreak + 'NewLine'; Params.HintFont.Style := Params.HintFont.Style + [fsBold]; Processed := True; end; ``` -------------------------------- ### Load Resources for PlannerEh Component (Pascal) Source: https://www.ehlib.com/online-help/ehlib-vcl-11-1/EhLibDoc/31-components-for-planning-management/01-components-for-planning-and-event-management Illustrates how to populate the Resources collection of TPlannerDataSourceEh by iterating through a resource DataSet and adding new resources with their associated properties. ```Pascal with TimePlanSourceEh1.Resources.Add do begin Name := mtResource.FieldByName('Name').AsString; ResourceID := i; // Assuming 'i' is a unique identifier end; ``` -------------------------------- ### Example: Export DBGridEh to Xlsx with Options Source: https://www.ehlib.com/online-help/ehlib-vcl-11-1/EhLibDoc/10-using-tdbgrideh-component/39-import-export-grid An example Delphi procedure demonstrating how to call the ExportDBGridEhToXlsx procedure with a populated TDBGridEhXlsMemFileExportOptions object. This example shows how to set various export properties to customize the output Xlsx file. ```Delphi procedure TForm1.actExportToExcelExecute(Sender: TObject); var Grid: TDBGridEh; Path: String; FileName: String; ExportOptions: TDBGridEhXlsMemFileExportOptions; begin Grid := TDBGridEh(ActiveControl); GetDir(0, Path); FileName := Path + '\DBGridEhAsXlsx.Xlsx'; ExportOptions := TDBGridEhXlsMemFileExportOptions.Create; ExportOptions.IsExportAll := True; ExportOptions.IsExportTitle := True; ExportOptions.IsExportFooter := True; ExportOptions.IsExportFontFormat := True; ExportOptions.IsExportFillColor := True; ExportOptions.IsCreateAutoFilter := True; ExportOptions.IsExportFreezeZones := True; ExportOptions.IsFooterSumsAsFormula := True; ExportOptions.IsExportDisplayFormat := True; ExportOptions.IsExportDataGrouping := True; // Assuming ExportDBGridEhToXlsx is accessible and correctly defined // ExportDBGridEhToXlsx(Grid, FileName, ExportOptions); end; ``` -------------------------------- ### Load Planner Events from Database to TPlannerDataSourceEh (Pascal) Source: https://www.ehlib.com/online-help/ehlib-vcl-11-1/EhLibDoc/31-components-for-planning-management/01-components-for-planning-and-event-management Demonstrates loading event data into TPlannerDataSourceEh by iterating through a DataSet and creating TPlannerDataItemEh objects. It also outlines an alternative method using DataSet binding via ItemSourceParams. ```Pascal PlanItem := PlannerDataSourceEh1.NewItem(); PlanItem.ItemID := MyDataSet1['Id']; PlanItem.StartTime := MyDataSet1['StartTime']; // ... other properties PlannerDataSource.FetchTimePlanItem(PlanItem); ``` ```Pascal PlannerDataSourceEh1.ItemSourceParams.DataSet := YourDataSet; // Configure TPlannerDataSourceEh.ItemSourceParams.FieldsMap ``` -------------------------------- ### Get Worksheet Count in TXlsWorkbookEh (Pascal) Source: https://www.ehlib.com/online-help/ehlib-vcl-11-1/EhLibDoc/32-txlsmemfileeh/02-txlsworkbookeh-class Returns the total number of worksheets currently present in the workbook. This property is read-only and useful for iteration or validation purposes. ```Pascal property WorksheetCount: Integer; ``` -------------------------------- ### Initialize DropDown Form with Parameters (Pascal) Source: https://www.ehlib.com/online-help/ehlib-vcl-11-1/EhLibDoc/20-drop-down-forms Handles the OnInitForm event to initialize the drop-down form. It retrieves parameters passed from the calling control, such as initial text for a memo component, and adjusts form elements based on a read-only state. This ensures the form is set up correctly before being displayed to the user. ```Pascal procedure TDropDownMemoEdit1.CustomDropDownFormEhInitForm( Sender: TCustomDropDownFormEh; DynParams: TDynVarsEh); begin if DynParams.Count >= 1 then Memo1.Lines.Text := DynParams.Items[0].AsString; sbOk.Enabled := not ReadOnly; Memo1.ReadOnly := ReadOnly; end; ``` -------------------------------- ### Create and Initialize TSettingsKeeperEh (Delphi) Source: https://www.ehlib.com/online-help/ehlib-vcl-11-1/EhLibDoc/10-using-tdbgrideh-component/43-storing-settings Demonstrates the creation of a TSettingsKeeperEh instance and the initial steps to populate it with form settings during form destruction. ```delphi destructor Destroy; begin SetKeeper := TSettingsKeeperEh.Create; WriteSettings(SetKeeper); // ... further processing like converting to JSON and saving SetKeeper.Free; end; ``` -------------------------------- ### Example Usage of TXlsWorkbookEh Properties (Pascal) Source: https://www.ehlib.com/online-help/ehlib-vcl-11-1/EhLibDoc/32-txlsmemfileeh/02-txlsworkbookeh-class Demonstrates the creation of a TXlsMemFileEh object and interaction with its Workbook property to rename a worksheet and add a new one. This illustrates basic workbook manipulation. ```Pascal xlsFile := TXlsMemFileEh.Create; xlsFile.Workbook.Worksheets[0].Name := 'DBGrid'; xlsFile.Workbook.AddWorksheet('VertGrid'); ``` -------------------------------- ### Add Multiple GroupLevels in TDBGridEh Source: https://www.ehlib.com/online-help/ehlib-vcl-11-1/EhLibDoc/10-using-tdbgrideh-component/20-working-with-data-grouping-mode This example demonstrates how to configure multiple group levels for TDBGridEh by grouping first by 'Continent' and then by 'Capital'. It uses BeginUpdate and EndUpdate for efficient modification and expands the first level nodes. ```delphi procedure TForm1.Button5Click(Sender: TObject); begin DBGridEh1.DataGrouping.GroupLevels.BeginUpdate; DBGridEh1.DataGrouping.GroupLevels.Clear; DBGridEh1.DataGrouping.GroupLevels.Add().Column := DBGridEh1.FieldColumns['Continent']; DBGridEh1.DataGrouping.GroupLevels.Add().Column := DBGridEh1.FieldColumns['Capital']; DBGridEh1.DataGrouping.GroupLevels.EndUpdate; //Expand all nodes of the First Level DBGridEh1.DataGrouping.GroupLevels[0].ExpandNodes; end; ``` -------------------------------- ### Preview TDBVertGridEh Component Source: https://www.ehlib.com/online-help/ehlib-vcl-11-1/EhLibDoc/12-dbvertgrideh-component/12-printing-dbvertgrideh Demonstrates how to trigger the print preview for a TDBVertGridEh component at runtime. This is a straightforward method call to initiate the preview functionality. ```pascal DBVertGridEh1.PrintService.Preview; ``` -------------------------------- ### Enable Hints and Tooltips in DBGridEh Source: https://www.ehlib.com/online-help/ehlib-vcl-11-1/EhLibDoc/10-using-tdbgrideh-component/36-hints-and-tooltips To display hints and tooltips in DBGridEh, the ShowHint property must be set to True. This applies to both general hints and specific column tooltips. ```Pascal DBGridEh.ShowHint := True; ``` -------------------------------- ### Add GroupLevel for a Field in TDBGridEh Source: https://www.ehlib.com/online-help/ehlib-vcl-11-1/EhLibDoc/10-using-tdbgrideh-component/20-working-with-data-grouping-mode This example shows how to add a new group level to the TDBGridEh component, specifically grouping data by the 'Continent' field. It also demonstrates expanding all nodes of the first level group. ```delphi procedure TForm1.Button2Click(Sender: TObject); var gl: TGridDataGroupLevelEh; begin gl := DBGridEh1.DataGrouping.GroupLevels.Add(); gl.Column := DBGridEh1.FieldColumns['Continent']; //Expand all nodes of the First Level DBGridEh1.DataGrouping.GroupLevels[0].ExpandNodes; end; ``` -------------------------------- ### Set Global DBGridEh Center (Pascal) Source: https://www.ehlib.com/online-help/ehlib-vcl-11-1/EhLibDoc/10-using-tdbgrideh-component/32-customizing-grid-title This global function is used to install a new center for DBGridEh grids. This is necessary for applying custom sorting behaviors and other grid-specific functionalities. ```Pascal uses DBGridEh; // ... in your initialization code ... SetDBGridEhCenter(TMyCustomGridCenter.Create); // Replace TMyCustomGridCenter with your custom center class ``` -------------------------------- ### TPlannerView OnReadPlannerDataItem Event Handler (Pascal) Source: https://www.ehlib.com/online-help/ehlib-vcl-11-1/EhLibDoc/31-components-for-planning-management/01-components-for-planning-and-event-management Handles the OnReadPlannerDataItem event, fired when reading TPlannerDataItemEh from a DataSource. Allows control over which items are read by setting the ReadDataItem parameter. ```Pascal property OnReadPlannerDataItem: TPlannerViewReadDataItemEventEh TPlannerViewReadDataItemEventEh = procedure (PlannerControl: TPlannerControlEh; PlannerView: TCustomPlannerViewEh; DataItem: TPlannerDataItemEh; var ReadDataItem: Boolean) of object; ``` -------------------------------- ### Dynamic Hint and Tooltip Formation with Events Source: https://www.ehlib.com/online-help/ehlib-vcl-11-1/EhLibDoc/10-using-tdbgrideh-component/36-hints-and-tooltips Utilize the OnDataHintShow event for DBGridEh or specific columns to dynamically generate hint and tooltip content. This allows for custom text, font, color, and position based on cell data. ```Pascal procedure TMyForm.DBGridEh1Column1DataHintShow(Sender: TObject; var HintInfo: TDBGridEhHintInfo); begin // Access dataset fields and set HintInfo properties HintInfo.Text := 'Custom Hint for ' + DBGridEh1.DataSource.DataSet.FieldByName('MyField').AsString; HintInfo.Font.Color := clYellow; HintInfo.Position := TPoint.Create(Mouse.CursorPos.X + 10, Mouse.CursorPos.Y + 10); // Call default processing if needed, or set Processed to True // DBGridEh1.DefaultFillDataHintShowInfo(Sender, HintInfo); end; ``` -------------------------------- ### Stop Incremental Search Method (Pascal) Source: https://www.ehlib.com/online-help/ehlib-vcl-11-1/EhLibDoc/10-using-tdbgrideh-component/22-searching-data-in-the-grid Stops the incremental search mode in the DBGridEh. This method is used to manually exit the incremental search state, for example, after a certain user action or timeout. ```Pascal procedure TCustomDBGridEh.StopInplaceSearch; ``` -------------------------------- ### Writing DBGridEh Settings using TSettingsKeeperEh Source: https://www.ehlib.com/online-help/ehlib-vcl-11-1/EhLibDoc/10-using-tdbgrideh-component/43-storing-settings Demonstrates saving the configuration of a TDBGridEh component to a TSettingsKeeperEh object. This includes column widths, search panel settings, and more. ```Pascal var GridSettings: TSettingsKeeperEh; begin GridSettings := TSettingsKeeperEh.Create; DBGridEh1.WriteSettings(GridSettings); Keeper.Add('DBGridEh1', GridSettings); ``` -------------------------------- ### Rebuild Pivot Fields in EhLib Source: https://www.ehlib.com/online-help/ehlib-vcl-11-1/EhLibDoc/30-components-for-consolidated-data-analysis/02-description-of-components Rebuilds the internal structure of pivot fields within the PivotDataSourceEh component. This is typically done after changes to the underlying DataSet or when initializing the pivot field structure. ```pascal PivotDataSourceEh1.PivotFields.RebuildPivotFields; ``` -------------------------------- ### Reading Form Settings from JSON with TSettingsKeeperEh Source: https://www.ehlib.com/online-help/ehlib-vcl-11-1/EhLibDoc/10-using-tdbgrideh-component/43-storing-settings Demonstrates how to initialize a TSettingsKeeperEh object and populate it from a JSON string. This is the first step in loading saved form configurations. ```Pascal procedure DoCreate; var SetKeeper: TSettingsKeeperEh; FormSettingsStr: String; begin SetKeeper := TSettingsKeeperEh.Create; JSONStringToSettingsKeeper(SetKeeper, FormSettingsStr); end; ``` -------------------------------- ### Start Incremental Search Method (Pascal) Source: https://www.ehlib.com/online-help/ehlib-vcl-11-1/EhLibDoc/10-using-tdbgrideh-component/22-searching-data-in-the-grid Initiates an incremental search within the DBGridEh. This method searches for a specified string, with options to set a timeout for the search and the direction of the search (forward or backward). ```Pascal procedure TCustomDBGridEh.StartInplaceSearch(const ss: String; TimeOut: Integer; InpsDirection: TLocateTextDirectionEh); ``` -------------------------------- ### Configure Page Header and Footer for TDBVertGridEh Source: https://www.ehlib.com/online-help/ehlib-vcl-11-1/EhLibDoc/12-dbvertgrideh-component/12-printing-dbvertgrideh Shows how to set the page header and footer for printing TDBVertGridEh components. These properties allow customization of text that appears on each page. ```pascal property PrintService.PageFooter; property PrintService.PageHeader; ``` -------------------------------- ### Merge Cells in EhLib VCL Source: https://www.ehlib.com/online-help/ehlib-vcl-11-1/EhLibDoc/32-txlsmemfileeh/09-combining-merging-cells Merges a specified range of cells within a worksheet. The MergeCell procedure takes the starting column and row, along with the number of columns and rows to merge. Values are 0-indexed. ```Pascal procedure MergeCell(Col, Row, ColCount, RowCount: Integer); // Example: To merge two cells horizontally Sheet.MergeCell(Col, Row, 2, 1); ``` -------------------------------- ### Control Hint Display Delay with Events Source: https://www.ehlib.com/online-help/ehlib-vcl-11-1/EhLibDoc/10-using-tdbgrideh-component/36-hints-and-tooltips The OnHintShowPause event allows you to specify the delay in milliseconds before a hint is displayed. Setting HintPause and Processed to True prevents default processing. ```Pascal procedure TMyForm.DBGridEh1HintShowPause(Sender: TObject; var HintPause: Integer; var Processed: Boolean); begin HintPause := 500; // 500 milliseconds delay Processed := True; end; ``` -------------------------------- ### Writing DBVertGridEh Settings using TSettingsKeeperEh Source: https://www.ehlib.com/online-help/ehlib-vcl-11-1/EhLibDoc/10-using-tdbgrideh-component/43-storing-settings Shows how to save the settings of a TDBVertGridEh component into a TSettingsKeeperEh object, similar to DBGridEh. ```Pascal var GridSettings: TSettingsKeeperEh; begin GridSettings := TSettingsKeeperEh.Create; DBVertGridEh1.WriteSettings(GridSettings); Keeper.Add('DBVertGridEh1', GridSettings); ``` -------------------------------- ### Set Font Size for Cell Range in EhLib Source: https://www.ehlib.com/online-help/ehlib-vcl-11-1/EhLibDoc/32-txlsmemfileeh/07-formatting-cells-in-a-table This snippet demonstrates how to get a reference to a specific range of cells using `GetCellsRange` and then set the font size for that range to 24 using the `IXlsFileCellsRangeEh` interface. It applies the changes using `ApplyChages`. ```pascal var cr: IXlsFileCellsRangeEh; begin cr := XlsFile.Workbook.Worksheets[0].GetCellsRange(0, 0, 1, 1); cr.Font.Size := 24; cr.ApplyChages; end; ```