Grouping Fields

edited April 2010 in FastReport 4.0
Hi my friends
for easy andrestand for you look at this sample:

Class
Lesson---Grade
First
A
68
First
B
100
First
C
72
Second--- A
80
Second----C
93

Ok, Now I want show my report like this shown:

Class
Lesson---Grade

A
68
First
B
100
C
72
Second--- A
80
C
93

I used this code:
  private
    s: string;
    cl: TColor;
//-----------------------------------------------
procedure TForm1.frxDBDataSet1First(Sender: TObject);
var
  Memo: TfrxMemoView;
begin
  s := frxDBDataSet1.DataSet.FieldByName('ClsName').AsString;
  Memo := frxDBDataSet1.FindObject('Memo1') as TfrxMemoView;
  Memo.Frame.Typ := [ftTop, ftLeft, ftRight];
  cl := Memo.Font.Color;
end;

procedure TForm1.frxDBDataSet1Next(Sender: TObject);
var
  Memo: TfrxMemoView;
begin
  Memo := frxDBDataSet1.FindObject('Memo1') as TfrxMemoView;
  if s <> frxDBDataSet1.DataSet.FieldByName('ClsName').AsString then begin
    Memo.Frame.Typ := [ftTop, ftLeft, ftRight];
    Memo.Font.Color := cl;
    s := frxDBDataSet1.DataSet.FieldByName('ClsName').AsString;
  end else begin
    if frxDBDataSet1.DataSet.Eof then
      Memo.Frame.Typ := [ftLeft, ftRight, ftBottom]
    else
      Memo.Frame.Typ := [ftLeft, ftRight];
    Memo.Font.Color := Memo.Color;
  end;
end;

Notes:
1. I would not using "Group Header"
2. I use Cross Table but not support RTL(Right To Left)!

Please help me
Regaurds

Comments

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.