Help - Search - Members - Calendar
Full Version: Space equally vertically
Fast Reports forum > Fast Reports Products > FastReport 4.0
Fabrizio Monti
Hi

let's suppose I have 3 child bands with a memo in each one. How can I space equally vertically my memos inside the bands?

I've thought to set memo's align = client and to set band height at runtime via script, but I'm wondering if there is an easier way to accomplish this.

Thank you so much!
gordk
QUOTE(Fabrizio Monti @ Feb 12 2010, 09:10 PM) *
Hi

let's suppose I have 3 child bands with a memo in each one. How can I space equally vertically my memos inside the bands?

Statement is ambiguous you only have 1 memo in each band or do you mean 3 memos in 1 band?
1 memo in each set the memoviews top to the top of the band "0", set the band height to the height of the memoview.
white space is created by the offset between top of band and top of memoview and the difference between bottom of memoview and band bottom.
size bands equally, chain together child1.child property points to child2 etc
also look at stretch , allowsplit prop of band, stretchmode, shift props of memoview
Anu de Deus
First, make it a DoublePass report.
This assumes the following order of printing (debug it to be sure) Memo1, Memo2, and Memo3, and all memos with align = alNone:

CODE
procedure Memo1OnAfterPrint();
begin
if Engine.FinalPass = false then
begin
Child2.stretch := true; // or: Child2.height := Memo1.height;
Memo2.top := Memo1.top;
Memo2.Height := Memo1.Height;
Memo2.left := Memo1.left;
Memo2.width := Memo1.width;



(repeat for memo3, here should be ok)

end;

end;



I didn't really run the above code, so if this doesn't work, it's because it may be the wrong event, you may need to pick another one (like Child2.OnBeforePrint),
one where the dimensions of Memo1 have already being set, and you still can change the dimensions of the other ones.

gordk
be careful when resetting design height and top properties of objects
effects are cumulative on sucessive iterations of the object, if the props are not reset and you can endup widowing objects to the page.
When controlling output, you should use the engine object's curx cury props
to control the position on the output page.
see the users manual on using the engine object.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.