Restrict masterdata to four rows per groupheader

edited 5:32AM in FastReport 4.0
I usae a groupheader and masterdata.
I want to restrict the number of rows to the first four of each group.
When I try Rowcount it gives me only four rows in the full report. I want to have four rows for each group.

Comments

  • gpigpi
    edited 5:32AM
    Use
    <line> div 4
    group condition
  • edited 5:32AM
    Hi joba!

    I'm in the same situation. Did you manage it. If I changed the group condition to <line> div 4 instead of fieldname the report not worked properly. It split one group's data into four rows with the same group name.
  • gordkgordk St.Catherines On. Canada.
    edited 5:32AM
    leave your group condition as to what it should be
    add code to your masterdataband
    typical
    procedure Band4OnBeforePrint(Sender: TfrxComponent);
    begin
    Band4.visible := (<line> < 5); // value is one highter than what you want display.
    end;
  • edited 5:32AM
    gordk wrote: »
    leave your group condition as to what it should be
    add code to your masterdataband
    typical
    procedure Band4OnBeforePrint(Sender: TfrxComponent);
    begin
    Band4.visible := (<line> < 5); // value is one highter than what you want display.
    end;

    Thanks gordk!

    But how can I do that at runtime. Should I add before print event with script? Can I do that with fastreport shipped with delphi xe2? Thx in advance.
  • edited 5:32AM
    gordk wrote: »
    leave your group condition as to what it should be
    add code to your masterdataband
    typical
    procedure Band4OnBeforePrint(Sender: TfrxComponent);
    begin
    Band4.visible := (<line> < 5); // value is one highter than what you want display.
    end;


    I tried that at runtime this way:
    Report.ScriptText.Clear;
    Report.ScriptText.Add('procedure MasterData1OnBeforePrint(Sender: TfrxComponent);');
    Report.ScriptText.Add('begin');
    Report.ScriptText.Add(' MasterData1.Visible := (<line> < 4);');
    Report.ScriptText.Add('end;');

    Report.ScriptText.Add('begin');
    Report.ScriptText.Add(' MasterData1.OnBeforePrint :='+''''+'MasterData1OnBeforePrint'+''''+';');
    Report.ScriptText.Add('end.');

    But it didnt' work.
  • gordkgordk St.Catherines On. Canada.
    edited 5:32AM
    AFAIK the version shipped with xe2 does not have scripting.

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.