Restrict masterdata to four rows per groupheader
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.
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
<line> div 4
group condition
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.
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.
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.