Printing a memo only the first time in a group
Manel
Barcelona, Catalonia
Hi all,
I'm making a report with group bands. It works fine but one thing. There is a memo in the MasterBand grouped that must be printed only in the first row in every group. This memo can't be placed in the GroupBand because it must be at the same level than other memos in the MasterBand.
I've tried to do it in this way.
In the OnBeforePrint of the GroupBand:
In the OnBeforePrint of the MasterBand:
I don't know why, but it doesn't work! There are no error but the memo is never printed...
Can anyone help me?
I'm making a report with group bands. It works fine but one thing. There is a memo in the MasterBand grouped that must be printed only in the first row in every group. This memo can't be placed in the GroupBand because it must be at the same level than other memos in the MasterBand.
I've tried to do it in this way.
In the OnBeforePrint of the GroupBand:
 begin
  ContRows := 0;
 end;
In the OnBeforePrint of the MasterBand:
 begin
  Memo.Visible := ContRows = 0;
  ContRows := ContRows + 1;
 end;
The idea is that the cunter is set to 0 each time the groupband is printed. When the MasterBand is going to be printed it set the memo visible only if counter = 0 and increments the counter.I don't know why, but it doesn't work! There are no error but the memo is never printed...
Can anyone help me?
Comments
try using line# variable in expression in the obp of the masterdataband.
line# resets at start of each group IIRC.
so
if [line#] = 1 then memo1.visible := true else memo1.visible := false;
should work
regards