Jump to content

able's Content

There have been 4 items by able (Search limited from 05-July 19)

By content type

See this member's

Sort by                Order  

#12099 TNXGrid, SaveToExcel procedure

Posted by able on 04 June 2009 - 10:51 AM in Users Contribution

Hi! I've wrote SaveToExcel procedure.

procedure TMForm.SaveToExcel(RGrid: TNxGrid);
XLApp: Variant;
i, n: integer;
XLApp:= CreateOleObject('Excel.Application');

XLApp.DisplayAlerts := false;


XLApp.Workbooks[1].WorkSheets[1].Name:='NXGrid Export';

XLApp.WorkBooks[1].WorkSheets[1].Rows[1].Font.Bold := true;

for i:=0 to RGrid.Columns.Count-1 do
XLApp.WorkBooks[1].WorkSheets[1].Cells[1,i+1] := RGrid.Columns[i].Header.Caption;

for i:=0 to RGrid.RowCount-1 do
  for n:=0 to RGrid.Columns.Count-1 do
    XLApp.WorkBooks[1].WorkSheets[1].Cells[i+2,n+1] := RGrid.Cell[n,i].AsString;

#12018 Caption and value of a cell

Posted by able on 25 May 2009 - 02:54 PM in NextGrid Component

I've found this http://dn.bergsoft.n...tom-sorting.htm

I think, it will help :-)

#12016 Caption and value of a cell

Posted by able on 25 May 2009 - 02:02 PM in NextGrid Component

QUOTE (Boki (Berg) @ May 25 2009, 01:20 PM) <{POST_SNAPBACK}>
Hello Maxim,

I am not sure that I understand a question, but I will try to answer smile.gif

Maybe setting SortType property of Column to stNumeric is what you need.

I hope that this helps. If not, please write me.

Best regards


I can give an example:

I want: when I'm creating htmlcolumn and setting values such as:

0: <font color="red">80</font> <font color="green">(190)</font>
1: <font color="red">180</font> <font color="green">(190)</font>
2: <font color="red">10</font> <font color="green">(190)</font>
3: <font color="red">120</font> <font color="green">(190)</font>
4: <font color="red">240</font> <font color="green">(190)</font>

and after descending sort:

0: <font color="red">240</font> <font color="green">(190)</font>
1: <font color="red">180</font> <font color="green">(190)</font>
2: <font color="red">120</font> <font color="green">(190)</font>
3: <font color="red">80</font> <font color="green">(190)</font>
4: <font color="red">10</font> <font color="green">(190)</font>

when I'm setting SortType to stNumeric IDE raises exaption 'EConverError' (which was expected).

#12014 Caption and value of a cell

Posted by able on 25 May 2009 - 01:14 PM in NextGrid Component


I need help: to put in a cell: $value1 ($value2).
To do this, well suited htmlcolumn, at the same time you can make up the correct values.

But I need to make a numeric sort by the $value.

Ie fact that the cells have two options: caption and value.
Caption is displaying on the screen to the user, and the value is the sorting, calculating footer, etc.

Can I do it be means of NXGrid?

P.S. Sorry for my English, I'm from Russia.