EHLIB's use

xiaoxiao2021-03-06  194

EHLIB's use

2003-12-5 15:22:29

Use TDBSUMLIST components

I still remember that I have asked such a question before: How to do statistical calculations like Excel under dbgrid, the words that use dbgrid are not easy, but now there is this, I believe it will be simple. The following is some instructions on the excerpt: [TDBSUMLIST Description] You can use TDBSUMLIST to record statistics in visual dynamic variation data. Set the relevant data fields in the data set you want to view, then write the sumlistChanged event to specify the operation you want to do after tdbsumlist changes. TDBSUMLIST's SUMCOLLECTION property lasts a TDBSUM object container. Each TDBSUM object is a component that can specify a collection value. FieldName and GroupOperation determine the type of collection value, and Sumvalue controls the current collection value. TDBSUMLIST is buried in the DBGRIDEH component, so the following is the same as the description of TDBGRIDEH.SUMLIST with TDBGIRDEH's TDBGRIDEH.SUMLIST attribute is the same. [How to work and why sometimes Sumlist's collection value is not correct? 】 You know that the Data-Aware control and dataset are connected via TDATALINK objects. TDATALINK does not allow quick recalculation of set values. For example, when the record is deleted from the data set, the data set sends a DedatasetChange event to all TDATALINK objects, and the same event is also sent when the current local filtering changes. Therefore, when TDATALINK receives the event, it has to recalculate the set value in all data sets, even only from the data set to delete a record. After activation, TDBSUMLIST overloads the following events: ONAFTEREDIT, ONAFTERINSERT, ONAFTEROPEN, ONAFTERPOST, ONAFTERSCROLL, ONBEFOREDELETE, ONAFTERCLOSE. This approach avoids it in all data sets. Other problems will occur when there is no need, such as: Terraite specified these events. Turn off the Sumlist before specifying one of the above events. In the following case, Sumlist issues an error message. SUMLIST trials to return the event to the data set, but the data set data is not deleted. In this case, data is placed in different forms (data modules), and the data set is placed in this case. In this case, try to close the sumlist when the data set data is deleted from the data set or data module. If you use the setRange or ApplyRange event, Sumlist will not track changes in the data set. However, you can call the Sumlist.ReCalAll method. In the main / schedule of non-BDE datasets, Sumlist cannot track data changes. After the primary data set activation status data set changes, call the sumlist.reclalAll method. In any other case, if you find that other sumlist's calculated values ​​are incorrect, you can call the recalall method.

2003-12-5 15:24:54

How to use EHLIB to achieve automatic sorting

There are some files that make automatic sorting of automatic sorting in EHLIB's DataService folder. TDBGRIDEH uses the related objects in these files to achieve automatic sorting when the sort tag changes. If you change the sorting mark of the data grid and the title without writing an onsortmarkingChanged event, the data grid will try to automate data. DBGRIDEHDATASERVICE tries to find a specific object that can be sorted in TDataSet through getDataSetFeaSfordataset. As you know, TDataSet does not support data sorting, but its derived object TQuery or TclientDataSet allows you to achieve data sorting. Using Process RegisterDataSetFeatureseh, you can register with the TDataSetFeaSehclass class, which can be sorted for TQuery, TadoQuery, and TclientDataSet objects. Simply add EHLIB ... (EHLIBBDE, EHLIBADO, EHLIBCDS) of the unit to any unit of EHLIB ... (EHLIBDE, EHLIBADO, EHLIBCDS), and the data grid connected to them will automatically sort the data set. EHLIBBDE, EHLIBADO, EHLIBCDS are initialized by calling the RegisterDataSetFeatureseh process in the unit data set. For other dataset types, you must write and register new objects that can be sorted by this data set. Writing Process T [Your Data Set] DataSetFeatureseh.ApplySorting, you can access columns that use the SortMarkedColumns property to achieve direct ordering. You can view the samples in the DBUTILSEH unit to understand how to write T [your dataset] DataSetFeatureseh class and view Ehlibbde units to understand how to register T [your dataset] DataSetFeatureSeh class. Data collection engine unit files BDE TQuery EhLibBDE ADO TADOQuery EhLibADO ClientDataSet TClientDataSet EhLibCDS DBExpress TSQLQuery EhLibDBX InterBase Express TIBQuery EhLibIBX [Translated by [Note]: In fact, to achieve this function is very simple (hereinafter me to BDE an example of how to achieve automatic sorting): 1. Place a DBGRIDEH component on the form and connect it to the corresponding BDE dataset; 2. Set the DGAUTOSORTMARKING attribute in the [Optionsen] of the component to true; 3. Double-click the component, attribute it pops up Add related fields in the editor; 4. Set the titlebutton property of [Title] of the list of the attribute list to be sorted to true; 5. Finally, don't forget to add EHLibBDE units in the USES clause. Ok, use the above way, you will find that the automatic sorting of data through EHLIB is actually as simple as it! 2003-12-5 15:39:37

The following text is taken from "Delphi Garden"

[Custom Grid Title] --- [Complex Title] TDBGRIDEH allows you to create a title on multiple columns, set the dbgrideh.usemultititle property to TRUE and populate the title of the tag or column header of the field, you can use the following rules: Field tab The text section or column header must be composed of several parts, and with "|" segmentation, each of several columns is set to the same. Other fields or titles must contain the same text in the corresponding portion. For example: Field1.displayLabel: = 'title1 | subtitle1'; Field2.displayLabel: = 'Title1 | Subtitle2'; or dbgrideh.columns [0] .title.caption: = 'Title1 | Subtitle1'; dbgrideh.columns [1]. Title.caption: = 'Title1 | Subtitle2'; - [PressTle Title] Set Column.title.titleButton to force the title unit for the True. Write the OntitLebTnClick event to control the operation when the user clicks the title unit. - [shown in the header bitmap] To show bitmap in titles instead of caption use TitleImages property of TDBGridEh and ImageIndex property of TColumnTitleEh -. [Automatic positional identification Order Title] TDBGridEh allows to show special sortmarking bitmaps (small triangles) in. the right part of title cell. in order to automatically marking title by sortmarking bitmaps add dghAutoSortMarking to OptionsEh property. Add dghMultiSortMarking too in order to allow sortmarking several columns simultaneously. Set Column.Title.TitleButton to true for titles which will have possibility to change sortmarkers at run time. At runtime clicking on title will change sortmarking. Holding Ctrl key allows to mark several columns simultaneously. After user change sormarking grid call OnSortMarkingChanged event. You can write this event to change sorting and reopen in dataset. Use SortMarkedColumns property to Access to Sortmarked Column. - The default value of the title attribute] Use TDBGRIDEH.COLUMNDEFVALUES.TITLE to set the default value for the title property.

[Custom Grid Person] - - [Footer and Statistics] TDBGRIDEH Allows to Show Special Row (Footer) Or Rows At Bottom Part. Use FooterrowCount Property to Specify The Number of Footer Rows in The Grid. Use Footer or Footers property of TColumnEh object to specify information which need to show in footer cells. Footers property useful then you have more then one footer rows. Footers is a collection of TColumnFooterEh objects where information from i-th aliment of collection will be show in i-th cell of footer column In footer cell, it is possible to show:.. Sum value for specified field, record count, value of a specified field or static text Use property Footer.ValueType or Footers [i] .ValueType to specify which type of value will be show in footer cell. If ValueType = fvtStaticText, then set the property value to specify text which need to show. If ValueType = fvtFieldValue, then you need to set property FieldName to specify field, value of which need to show. to Force Grid to Calculate Total Values ​​Need to Activa te SumList (DBGridEh.SumList.Active: = True). Set ValueType to fvtSum and grid must to show sum value of the column field in the footer cell, you can also specify Column.Footer.FieldName to calculate total value of the other field SET VALUETYPE TO FVTCOUNT to Force Grid To Show Count of Records in The Footer Cell.- [Custom Grid Data Unit] The display field value is shown in the data unit.

TDBGridEh allows to show bitmaps from TImageList component depending on field values ​​To show bitmaps depending on field values ​​need:. Fill list of field values ​​to Column.KeyList property (every value in separate line) and set Column.ImageList property to ImageList control that has the bitmap in according index. Set Column.NotInKeyListIndex to index of bitmap that will be shown if field's value does not correspond to any value in KeyList (for instance you can set index of image for Null field value). At run time you are not . allowed to edit bitmap in column cell Use blank key and mouse click to set next value from Column.KeyList to the field;. Shift-blank key and Shift-Mouse click to set previous value from Column.KeyList Set Column.DblClickNextval to True have allows to change value on mouse double click. [check logic, and the non-block type logic value] Grid automatically shows checkboxes for boolean field. to show checkboxes for non boolean fields fill first line of Column.KeyList property that corresponds to the ch ecked state of the checkbox, second line -.. non checked state, and set Column.Checkboxes ptoperty to True Line of KeyList can represent more than one value in a semicolon-delimited list of items [] using data row height properties RowHeight and RowLines To specify the high data line. Complete data line high = line height travel height. Set RowsizingAllowed to True to allow you to use a mouse to change the row. Setting Column.WordWrap to TRUE to make multiple lines of text in the data line. If you are high> text, it will wrap. [Display Remarks field] Set DrawMEMOTEXT to TRUE to display a textual note field. [Customized cell font and color] The font and color attributes in TDBGRIDEH describe the fonts and colors of the cells in the data grid. The Font and Color properties in TColumneh describe fonts and colors that draw cells in the specified column. [Event custom cell fonts and colors] There are several events that allow you to customize cell fonts and colors before drawing cells. You can write TDBGRIDEH's OnDrawColumnCellevent event handle to draw data in the grid unit. You can use the canvaS property to draw cells. But if you just want to change the properties of the font or color, I suggest you use the following events.

You can write TDBGRIDEH ONGETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCET to control the operations specified before drawing data units. You can change the drawing font and background colors. This event is suitable for you to use when you want to change the font or color of the whole line. If you want to change the properties of the cell in the specified column, you can use TColumneh.ongetcellparams. Write this event to control the operation when a column data unit is redrawn or edited. Before a column data unit is redrawn, you can change the drawing font, background color, alignment, image index, text, or check box. Before editing a column data unit, you can change the edit font, background color, text, or read state. [Default value for column properties] Use the ColumnDefVALUES properties to set the default value of the column properties. The newly created column will get attribute values ​​from the ColumnDefValues ​​property, and until the first time you specify. [Place the editor in the grid] --- [Several fields in the drop-down list] Show a few drop-down fields in the drop-down list, you need to set the list of LookupDisplayFields properties to the semicolons properties of the field to split multiple fields name. The property named column.field.lookupResultfield must be in the LookUpDisplayFields list. Multi-field drop-down lists can only be applied to the drop-down field. - [Show the drop-down method] You can display other text in the relevant field via Keylist and Picklist properties. Keylist displays the value contained in the field rather than the PickList index. Column.NotInKeyListIndex to index of text from PickList that will be shown if field value do not contain in KeyList (for instance you can set index of text for Null field value). Set Column.DblClickNextval to True to change value on mouse double click. - [Down-pull calculator] For TDATEFIELD and TDATETIMEFIELD fields, the Inplace editor will display the drop-down button to display the display drop-down calculator. Set column.ButtonStyle to CBSNE to disable the display drop-down button. [Set the editor color and font] Inplace editor can set the color and font of the data unit. The data unit uses the ONGETCELLPARAMS event to control the column color and font. The INPLACE editor automatically sets to multi-line mode when row> a row and sets the attribute wordWrap of the column to true. To set the width of the grid equal to the customer area width. The MinautofitWidth property determines the minimum width of the grid and the column width will be recalculated. [3D or plane appearance] Use an OptionseH property to display / hide fixed 3D framework, cold area, footer, and data lines. Use the FLAT attribute to set the data grid with a flat mode. [Import / export data from multiple formats / export data to TDBGRIDEH] EHLIB's function set can export data from DBGRIDEH to Text, CSV, HTML, RTF, XLS, and its internal format. It saves data to stream (TSTREAM object) or file.

Examples Pascal: SaveDBGridEhToExportFile (TDBGridEhExportAsText, DBGridEh1, 'c: /temp/file1.txt',False); C : SaveDBGridEhToExportFile (__ classid (TDBGridEhExportAsText), DBGridEh1, "c: //temp//file1.txt", false); EHLIB's function set can be imported from Text and its internal format data into DBGRIDEH data set. It can read data from the file or read data to the stream (TSTREAM object). [Other Features] - With the Lookup editor, you can empty (set to null) lookupKeyfield values ​​at runtime. For example, choose the entire text and press the DELETE button. - [Cold Zone] The cold area is the non-rolling area displayed on the left side of the data grid column. Unlike the fixed column, the column of the cold zone can obtain editing focus. You can set the column set on the right by setting the Frozencols property. - [Incremental Search] TDBGRIDEH allows users to implement specific "increment" searches in the grid column. When the user enters incremental searches, he can display characters and grids, and look for text in the current column. Use DGHINCSEARCH and DGHPREFERINCSEARCH (in the Optionseh option) Operate the search in the data grid. The DGHINCSEARCH value allows incremental searches in the data grid. When you run, you can use the following to perform incremental search: Ctrl f - Start incremental search. Ctrl Enter - Find the next match record. Ctrl Shift ENTER - Find the previous match record. If the dghincsearch in the optionSeh option is read-only, the network will automatically set the increment mode to return to normal mode after the first button and 1.5 seconds. DGHPREFERINCSEARCH Value Decision Grid Setting Auto Increment Search Mode Alternate unit editing during the first button. [Horizontal or vertical scroll bar] Use VertsctollBar, HorzsctollBar properties to display / hide and track horizontal or vertical scroll bars. [Multiple selection] TDBGRIDEH allows you to select a record, column, and rectangular area on the selected area: × Allow multiple elections to affect the following properties: The DGMultiSelect property in the Options option - Set whether you allow multiple choices. The DghcleRSerection property in the Options option - setting whether the selected record is cleared when the user moves to the next unit. The EditActions Properties in the Options option - Settings Users can perform which operations can be performed on the selected record (such as copy, cut, delete, paste, all choice, etc.). AllowedSelections properties in the Options option - Set the type (such as line, column, rectangular area, etc.) that allow the selected record. Selection attribute in the Options option - Sets a current multi-select state, selected record, column, or rectangular area, and attributes and functions to access them. [Saving or recovering the slave and columns from the registry or in INI file] TDBGrideh has a registered to save and restore the network from the registry or ini file and the hierarchy of the column: RestoreColumnsLayout - Sequence from the registry , Width, sort flag. RestoreColumnsLayoutini - The order, width, and sort flag of recovered columns from the INI file.

RESTOREGRIDLAYOUT - The order, width, visual, sort flag, sorting index, or rising high from the registry. RESTOREGRIDLAYOUTINI - The order, width, visual, sort flag, sort index, or rising high from the INI file. SAVECOLUMNSLAYOUT - Save the order, width, and sort flag to the registry. SaveColumnsLayoutini - Save the order, width, and sort flag to the INI file. SaveGridLayout - Save the order, width, visual, sort flag, sort index, or row to the registry. SaveGridLayoutini - Save the order, width, visual, sort flag, sort index or row to the INI file. "The following is for reference only, because I don't know how much it is, the latest version is 3.2, I am using it, I feel very good ~~" The current version of TDBGrideh does not support the characteristics: TDBGRIDEH can't set each one Alone in the data window is high. TDBGRIDEH cannot work as TreeView. It cannot have nodes and branches. TDBGRIDEH does not merge the data unit laterally or vertically. [Convert existing TDBGRID components to TDBGRIDEH components]: Although TDBGrideh is not inherited from the TCUSTOMDBGRID component, there are still similar properties in TDBGRIDEH and TDBGRID. It allows only a little cost to convert existing TDBGRID components to TDBGRIDEH. [Note]: You can turn the existing TDBGRID component to TDBGrideh in accordance with the prompts below: Open the application containing TDBGRID components in the Delphi IDE. Set the view mode as a text method (ALT-F12).

if key = VK_RETURN then // Key: Enter begin if (grdDetailData.SelectedIndex = grdDetailData.Columns.Count-1) and not (dgRowSelect in grdDetailData.Options) then BEGIN if (dgEditing in grdDetailData.Options) and (grdDetailData.Row = GrddetAildata.rowcount-1) THEN // Can be edited from table Grid and current cursor focus in the last row acadddetailexecute (self) else begin grddetaildata.row: = grddetAildata.row 1; // change the cursor focus line to the next line (when a new increase, without running phrase grdDetailData.SelectedIndex: = 0 // change the cursor focus column to the first column end; END ELSE BEGIN grdDetailData.SelectedIndex: = grdDetailData.SelectedIndex 1; while grdDetailData.Columns [grdDetailData. SelectedIndex] .ReadOnly do grdDetailData.SelectedIndex: = grdDetailData.SelectedIndex 1; END; key: = 0; end; if key = VK_INSERT then // Insert key: a new record begin acAddDetailExecute (self); key: = 0; End; if key = vk_delete then/ delte: Delete a record becomecute (self); key: = 0; end; [Football 3) 1, set the FOOTERROWCOUNT value of the dbgrideh property is 1; 2. Set DBGRI The SUMLIST of the DEH attribute is true; 3, set the value of the FOOTER of the column you request to be fvtsum; 4, run OK! Write when Dataset is opened: dbgrideh1.columns [0] .footer.value: = INTTOSTR DBGRIDEH1.DATASOURCE.DataSet.Recordcount; 2003-12-5 16:56:13

How can EHLIB's DBGRIDEH control can output files like DXDBGRID controls to Excel

The following codes are derived EHLIB :( EHLIB the fact already DEMO1) procedure TInvoiceManager.ppmSaveSelectionClick (Sender: TObject); var ExpClass: TDBGridEhExportClass; Ext: String; begin SaveDialog1.FileName: = 'file1'; if (ActiveControl is TDBGridEh ) then if SaveDialog1.Execute then begin case SaveDialog1.FilterIndex of 1: begin ExpClass: = TDBGridEhExportAsText; Ext: = 'txt'; end; 2: begin ExpClass: = TDBGridEhExportAsCSV; Ext: = 'csv'; end; 3: begin ExpClass: = TDBGridEhExportAsHTML; Ext: = 'htm'; end; 4: begin ExpClass: = TDBGridEhExportAsRTF; Ext: = 'rtf'; end; 5: begin ExpClass: = TDBGridEhExportAsXLS; Ext: = 'xls'; end; else ExpClass : = NIL; EXT: = '; end; if expclass <> nil dam if uppercase (copy (savedialog1.filename) - 2, 3) <> Uppercase (ext) Then Savedialog1.FileName : = Savedialog1.FileName '.' Ext; savedbgridehtoexportfile (Expclass, TdbGrideh (ActiveControl), Savedialog1.Filena ME, FALSE); End; end; end; 2003-12-5 17:05:48

EHLIB installation in Delphi 7 (I spent a half-day strength to get it)

Delphi 7 installation method 1. Copy the CommON and DataService files in EHLIB to the Delphi7 directory. 2. Add to the EHLIB path in Tools-> Environment Options-> library-> library path. 3. Open the ehlib70.dpk in the new folder, compile it, but don't install it. 4. Open DCEHLIB70.DPK in EHLIB, compile, installation 5. Open DCLEHLIB70.DPK in Delphi 7, compile and install. 6. An EHLIB component page appears in the component panel. 7. Open the included Demos, compile and run, and the test is successfully installed.

2003-12-8 16:41:54

How is the footer property of the DBGRIDEH control?

0, will dbgrideh.footerrowcount: = 11, will dbgrideh.Sumlist.Active: = true; 2, the columns [requirements and fields] .footer.valueType: = VTSUM;, finally, pay attention, in the FormClosequery event, must To put sumlist.active: = false, because FormClose will let DBGrideh release all EHLIB resources in the data set, it will make Sumlist.Active: = false will not cause the exit 2003- 12-10 11:22:37

How to implement different rows in DBGRIDEH display different colors? Or a certain line showing a specific color?

[Implement] DBGridEh interlaced display dichroic procedure TForm1.DBGridEh1GetCellParams (Sender: TObject; Column: TColumnEh; AFont: TFont; var Background: TColor; State: TGridDrawState); begin if DBGridEh1.SumList.RecNo mod 2 = 1 then Background: = $ 00FFC4C4 else Background: = $ 00FFDDDD; end; {DBGridEh under certain conditions, display a particular color line} procedure TForm1.DBGridEh1GetCellParams (Sender: TObject; Column: TColumnEh; aFont: TFont; var Background: TColor; State: TGridDrawState) Begin // Set the row background color (ADO setting) at the Name field value (ADO setting) if adoQuery1.fieldbyname ('name'). asstring = 'aaa' the background: = 00ffc4c4 // In the XM field value Li Ming Row Setting Row Background Color (BDE Settings) Else if DBGRIDELDBYNAME ('XM'). Asstring = 'li ming' The background: = $ 00ffc4c4 else background: = $ 00ffdddd;

2003-12-10 14:19:28

DBGRIDEH control Export files to Excel supplementary instructions (about multi-table export design ideas)

If the head is like: | Mergetitle | ------------ COL1 | Col2 analysis of the header, then according to its header '|', it is still original | Mergetitle | Mergeti ---------------------- COL1 | col2 is imported into the EXCEL to merge the cell!

2003-12-10 14:55:16

Allow multiple lines in DBGRIDEH, how do you know which rows are selected?

It is an attribute of a Bookmark type. SelectedRows: TBookmarkListprocedure TForm1.Button1Click (Sender: TObject); vari, j: Integer; s: string; beginif DBGrid1.SelectedRows.Count> 0 then with DBGrid1.DataSource.DataSet do for i: = 0 to DBGrid1.SelectedRows.Count- 1 Do Begin Gotobookmark (Pointer (DBGrid1.SelectedRows.Items [i])); for j: = 0 to Fieldcount-1 Do Begin if (j> 0) THEN S: = S ','; s: = S Fields [j] .sstring; end; listbox1.items.add (s); s: = '; end; end; 2003-12-10 15:06:19

After selecting multiple rows on DBGRIDEH, the selected records are required to add all of the fixed tables of the SQL database.

DBGRIDEH.SelectedRows recorded all Bookmark selected, using SelectedRows and GotoBookmark. Code is as follows: procedure TForm1.Button1Click (Sender: TObject); vari, j: Integer; s: string; beginif DBGrid1.SelectedRows.Count> 0 then with DBGrid1.DataSource.DataSet do for i: = 0 to DBGrid1.SelectedRows.Count -1 Do Begin Gotobookmark (Pointer (DBGrid1.SelectedRows.Items [i])); for j: = 0 to FieldCount-1 Do Begin if (j> 0) THEN S: = S ','; s: = s Fields [j] .sstring; end; listbox1.items.add (s); s: = '; end; end;

2004-2-11 12:45:10

Click Title directly in DBGRIDEH to sort the way you click on the field.

The first method (not tested) procedure TForm1.DBGridEh1TitleClick (Column: TColumnEh); begin // Click GridEh heading to sort if (Column.Title.SortMarker = smNoneEh) or (Column.Title.SortMarker = smDownEh) then begin ADOQuery1.SORT : = Column.fieldname; column.title.sortmarker: = smupeh endelse begin adoquery1.sort: = column.fieldname 'desc'; column.title.sortmarker: = smdowneh end; end; second method (unstected) Procedure TPrintMai_frm.DBGridEh1TitleClick (Column: TColumnEh); varsortstring: string; begin // sort with Column dobegin if FieldName = '' then Exit; case Title.SortMarker of smNoneEh: begin Title.SortMarker: = smDownEh; sortstring: = Column.FieldName 'Asc'; end; smdowneh: sortstring: = column.fieldname 'ASC'; SMUPEH: Sortstring: = Column.fieldName 'dec'; END; // Data set sort. Try dm.datamodule1.qry2.sort: = Sortstring // DataSet is the actual data set variable name ExcePt end; end; end; 2004-3-24 17:34:05

EHLIB color control and printing

From: http://www.delphibbs.com/keylife/iblog_show.asp?xid=191 Many said that the different colors from the data grid are displayed in the DrawColumnCell event, but there is no problem, but in EHLIB If you want to print it, you can't.

ehlib provides GetCellParams events, you can display and print // display only, can not be printed procedure TfrmQueryContractInfo.DBGrid1DrawColumnCell (Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumnEh; State: TGridDrawState); varOldColor, OldColumnColor: TColor v: tcolcellparamseh; begin {oldcolor: = dbgrid1.canvas.font.color; if (color1.field.fieldname = 'filling the transfer time') Thenif (dbgrid1.datasource.DataSet.fieldByname ('fill the transfer time ') .ASDateTime> dbgrid1.datasource.dataset.fieldbyname (' should ship time ') .aSDatetime) .aSDatetime) .sdatetime) thnbegin //v:=tcolcellparamseh.create; //clumn.getcolcellparams(true ,v); //v.font. Color: = CLRED; //column.fillcolcellparams (V); //v.free; dbgrid1.canvas.font.color: = CLRED; end; // column.getcolcellparams .fillcolcellparams () IF (colord.fieldname = 'Handling Time') Thenif (DBGRID1.DataSource.DataSet.fieldByname ('Handling Time') .asdatetime> DBGrid1.DataSource.DataSet.fieldByname ('Ship Time') .aDatetime) Then dbgrid1.canvas.font.color: = CLRED; if (column.field.fieldname = 'filled transportation single time') Thenif (dbgrid1.datasource.dataset.fieldbyname ('filling the transport single time') .aSDateTi me> DBGrid1.DataSource.DataSet.FieldByName ( 'fill Retrieval time') .AsDateTime) then DBGrid1.Canvas.Font.Color: = clRed; DBGrid1.DefaultDrawColumnCell (Rect, DataCol, Column, State); DBGrid1.Canvas. Font.Color: = OldColor;} end; // can display, print procedure TfrmQueryContractInfo.DBGrid1GetCellParams (Sender: TObject; Column: TColumnEh; aFont: TFont; var Background: TColor; State: TGridDrawState); varOldColor, OldColumnColor: TColor; v: tcolcellparamseh; begin // OldColor: = dbgrid1.canvas.font.color; if (color1.field.fieldname = 'filling the transfer time') Thenif (dbgrid1.datasource.DataSet.fieldbyName ('fill the transfer time '

转载请注明原文地址:https://www.9cbs.com/read-128491.html

New Post(0)