Custom Line Number
Hello people,
I'm working on a Delphi module that generates a list of data from a query.
the data is being grouped by a field, I use [Line] to show the line number for each group.
I also use [Line] for the rows within that group to show the number of those, and it resets itself for each group. So, for the first group line no. is 1, then the child rows of that group get 1 to ... . the second group gets 2 as line number, and its child rows again get from 1 to the end.
What I want to achieve is to have the child's line number according to it's parent (grouped) line number, So if the group line number is 1, then I want it's child rows to have 1.1, 1.2, and so on.
Then for group no 2, I want it's child have 2.1, 2.2, 2.3 and so on...
How can I achieve this? Any help is much appreciated.
Thanking you in advance,
I'm working on a Delphi module that generates a list of data from a query.
the data is being grouped by a field, I use [Line] to show the line number for each group.
I also use [Line] for the rows within that group to show the number of those, and it resets itself for each group. So, for the first group line no. is 1, then the child rows of that group get 1 to ... . the second group gets 2 as line number, and its child rows again get from 1 to the end.
What I want to achieve is to have the child's line number according to it's parent (grouped) line number, So if the group line number is 1, then I want it's child rows to have 1.1, 1.2, and so on.
Then for group no 2, I want it's child have 2.1, 2.2, 2.3 and so on...
How can I achieve this? Any help is much appreciated.
Thanking you in advance,
Comments
var i,j:integer //i - groupd id, j - line#
//count groupd id and clear line# before groupheader print
procedure GroupHeader1OnBeforePrint(Sender: TfrxComponent);
begin
with GroupHeader1,Engine do
begin
i:=i+1;
j:=0;
end;
end;
//count line# before MasterData1 print
procedure MasterData1OnBeforePrint(Sender: TfrxComponent);
begin
With masterData1,engine do j:=j+1;
end;
//initial group id
Begin
i:=0;
End.
The expression in Memo: .[j]