engine.freespace not updated ?
procedure GroupFooter1OnBeforePrint(Sender: TfrxComponent);
var mHeight: double;
begin
mHeight := GroupFooter1.height + child1.height;
while (engine.freeSpace > mHeight) or (JustPrintedHeader = true) do
begin
engine.ShowBand (Child1);
end;
The goal of the above is to have vertical lines between the last masterdetail and the groupfooter which I want always @ the bottom of the page.
This works perfectly if there is enougn space to at least print the group footer. and the page footer but if , in attempting to print the group footer fr4 realises that there is not enough space the following happens
- page footer is printed
- new page
- page header is printed
- group footer is printed
which is what you would expect, EXCEPT that the engine.freespace still has the values of the previous page so it print immediately and not at the bottom of the page. (in fact it lloks like all variables keep their values at the time of call of the obp, I tried to set a boolean on the page header OAP event and I always get the value false)
How can I get around this ?
Didier
var mHeight: double;
begin
mHeight := GroupFooter1.height + child1.height;
while (engine.freeSpace > mHeight) or (JustPrintedHeader = true) do
begin
engine.ShowBand (Child1);
end;
The goal of the above is to have vertical lines between the last masterdetail and the groupfooter which I want always @ the bottom of the page.
This works perfectly if there is enougn space to at least print the group footer. and the page footer but if , in attempting to print the group footer fr4 realises that there is not enough space the following happens
- page footer is printed
- new page
- page header is printed
- group footer is printed
which is what you would expect, EXCEPT that the engine.freespace still has the values of the previous page so it print immediately and not at the bottom of the page. (in fact it lloks like all variables keep their values at the time of call of the obp, I tried to set a boolean on the page header OAP event and I always get the value false)
How can I get around this ?
Didier
Comments
freespace - groupfooterheight+1or 2 pixels divided by childheight
The trouble is ... Freespace still gets the value it had before the page break, not the actual value it really has on the new page. So that' won't work either.
Didier
BTW what version and build number are you using?
Version is 4.9.100; the fact that it does not reset is a real pain as it throws away any logic used to physically position a band at a specific location on a page when the object you're trying to position is the overspill object ; unless you come up with one of your cunning tricks [img]style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> Didier[/img]
as i look at your code i am begging to suspect your or section may be inadvertently causing the problem(where is it reset to false).
if you want to see where freespace resets just add some memos with [engine.freespace]