![]() There are two classes in this module: TfrxDBGridEhColumnsEditorForm – a form of the column editor with the necessary functionality and TfrxDBGridEhEditor to connect (call) our editor from the FastReport designer. In the initialization section, register this editor in the FastReport environment to visually edit the frxDBGridEh column set. At this stage, we create a grid column editor similar to the column editor in Delphi. This module uses FastReport’s visual work with collections in the designer. Now let’s add another frxDBgridEhColumnsEditor module to our package (this is the code plus the form). Grid registration in the FastReport component palette.Description of grid event handlers for different report script programming languages.Note the initialization section that specifies: The published section contains properties and event handlers that will be visible in the FastReport Designer Object Inspector and that can also be set in the report script. Procedure DoColWidthsChanged(Sender: TObject) įunction ReadNestedProperty ( Item : TfrxXmlItem ) : Boolean override Procedure DoCellClick(Column: TColumnEh) ![]() Procedure DoDrawColumnCell(Sender: TObject const Rect: TRect DataCol: Integer Column: TColumnEh State: TGridDrawState) Procedure DoGetBtnParams(Sender: TObject Column: TColumnEh AFont: TFont var Background: TColor var SortMarker: TSortMarkerEh IsDown: Boolean) Procedure DoTitleBtnClick(Sender: TObject ACol: Integer Column: TColumnEh) Procedure DoGetCellParams(Sender: TObject Column: TColumnEh AFont: TFont var Background: TColor State: TGridDrawState) ![]() Procedure SetDataSetName(const Value: String) Procedure SetDataSet(const Value: TDataSet) These three methods are needed to be able to connect a basic data source of the TfrxDBDataset (FastReport) or TDataSet (Delphi) type to the grid. These system procedures are needed to save and restore grid columns to the fr3 report template. Variables that will store the name of the event handlersįOnGetCellParams :TfrxGetCellParamsEvent įOnDrawColumnCell :TfrxDrawColumnCellEvent In this file, for registration in Delphi, we will declare the component:įDBGridEh :TDBGridEh // The base component, the properties of which we will set and methods of which we will callįDataSource :TDataSource // Interface between grid and data source in FastReport We add a new file frxDBGridEhControl.pas, which will be the basis of our grid. Delphi 10.4.2 is used as the development environment, but everything described below will be suitable for any other Delphi starting from version 7 (adjusted for the version).Ĭreate a new package (dpk) and give it the name frxDBGridEh27. To display data from the database, this article uses the DBGridEh component from the EhLib VCL library, which will be integrated into the FastReport dialog. Accordingly, in this article, we will talk about writing such a component.įor more information, we recommend reading the official documentation In fact, they are analogs to ordinary Delphi components, which can be used in dialog forms FastReport. But sometimes this is not enough and you have to write your own dialog components for FastReport. In the RAD Studio IDE Software, on the fastReport prepress dialog, there are already a number of components, for example, Label, Edit, Button, Memo. ![]() but also a convenient prepress dialog where the user can set the parameters for generating the report. When creating a report, it is important not only to make a beautiful printed form that will display the data necessary for the user.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |