Printing a memo only the first time in a group

ManelManel Barcelona, Catalonia
edited 8:17PM in FastReport 2.xx VCL
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:
  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

  • gordkgordk St.Catherines On. Canada.
    edited 8:17PM
    Hi Manel
    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 ;)
  • ManelManel Barcelona, Catalonia
    edited 8:17PM
    It works fine, thanks

    ;)

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.