Moving Report Components

edited 8:36AM in FastReport 4.0
I want to be able to show or hide various parts of a report, depending on some criteria a user selects. I know how to reference report objects and make them visible or invisible, but when a non-visible component is hidden it still seems to occupy space in the generated report.

For example, say I have a report with three memo fields: mmoOne, mmoTwo and mmoThree. If I hide mmoTwo I would expect mmoThree to appear immediately under mmoOne in the generated report. However, what happens is that mmoThree stays where it is and, although the contents of mmoTwo are not visible, the space it occupies is.

Is there a way for visible report components to automatically move to the space occupied by a component that has been set to Visible = False? Is there a property I need to set?

Sorry if I haven't explained that clearly. [img]style_emoticons/<#EMO_DIR#>/blink.gif" style="vertical-align:middle" emoid=":blink:" border="0" alt="blink.gif" /> Thanks. Regards, Steve[/img]

Comments

  • Anu de DeusAnu de Deus Hampshire, UK
    edited 8:36AM
    I make my components invisible all the time, but I don't have that problem of yours.
    However, I'm doing mostly by code (I assume it has same effect as if done with the desginer), before calling .PrepareReport or .show
    At which point are you doing it? In which event?
    I think I also change some visibility on OnBeforePrint event of a page (because that happens before the same event of each band), try that if not doing it yet.
  • gordkgordk St.Catherines On. Canada.
    edited 8:36AM
    Steve you are only changing the visibility of the object not its position on the output page.
    the report engine processes from top down by band type and left to right in the band in order
    the objects were created, you therefore cannot modify an object which has been
    handled already(output), from events of an object which follows it.
    Great care should be taken when modify object, design props, you can widow an object to the page from its band.
    Look at the user manual script chapter on using the engine object to modify output positions.
    curx cury.
    you can also have memos that contain multiple datafields on each line

    and write code to stip white space
    procedure mLabelOnAfterData(Sender: TfrxComponent);
    var i: integer;

    begin
    for i := TfrxMemoView(Sender).Lines.Count - 1 downto 0 do
    begin
    if TfrxMemoView(Sender).Lines.Strings = '' then
    TfrxMemoView(Sender).Memo.Delete(i);
    end;
    end;

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.