Dynamic child band creation

Hi all,

I've an application which uses some dynamic tables (two dimensions array of string not DB).

I want to report theses tables so I use two children to add child band:
  Band := TfrxReportSummary.Create(frp_Main.Pages[1]);
  Band.CreateUniqueName;
      if Assigned(Child1) then
      begin
        Child2 := TfrxChild.Create(frp_Main.Pages[1]);
        Child1.Child := Child2;
      end
      else
      begin
        Child2 := TfrxChild.Create(frp_Main.Pages[1]);
        Band.Child := Child2;
      end;
      Child2.CreateUniqueName;
      DrawTable(Child2, ...);

But I get it overlapped.

Any suggestion please.

Regards.

Comments

  • Anu de DeusAnu de Deus Hampshire, UK
    edited September 2009
    Give it a try at setting up the top properties of the child objects.
    Like Child2.top := child1.top +child1.height +1

    Also, to understand what's going on, after you created all objects and prepared the report, export it into a .fr3 file, open the result again with the editor and check how the objects are placed, it will help you to visualise where the objects create at runtime were place and the source of your problem.
    If you want to dig further, then edit the objects in the editor (if possible, can be tricky without the right datasets) until you get the right output, and then try to mimic the final correct layout from your code by setting all properties missing.
  • edited 9:28AM
    Hi Anu de Deus,

    Thank you very much for your reply.

    I've fixed my problem.

    Best regards.

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.