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,

Comments

  • edited November 2011
    //set two var for group id & line number
    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]

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.