Problem with summary
Hi
I have serious problem with fuction SUM in my reports.
Report has folowing bands:
Title, MasterData and Summary. I use script code to
align Summary band to bottom. This code looks like this:
On Summary band, I've placed a text field with code
When report fits one page, everything is ok (text field displays
correct summary), but when there are two pages, text field remains
empty!.
Take look at these pictures:
Good (one paged report)
Fastreport
Bad (two paged report, field with descritption "Sum" is empty)
Fastreport
If there is at least one item (from MasterData band) on second page
everything is ok again.
Fastreport
And when I remove the code to align Summary band,
everything is ok too.
Do you have any ideas what is going on?
I have serious problem with fuction SUM in my reports.
Report has folowing bands:
Title, MasterData and Summary. I use script code to
align Summary band to bottom. This code looks like this:
    if Engine.FreeSpace < ReportSummary1.Height then
        Engine.NewPage;
   Engine.CurY := Engine.CurY + Engine.FreeSpace - ReportSummary1.Height - 1;
On Summary band, I've placed a text field with code
[SUM(<frxDBDataset1."NUMER">,MasterData1)]
When report fits one page, everything is ok (text field displays
correct summary), but when there are two pages, text field remains
empty!.
Take look at these pictures:
Good (one paged report)
Fastreport
Bad (two paged report, field with descritption "Sum" is empty)
Fastreport
If there is at least one item (from MasterData band) on second page
everything is ok again.
Fastreport
And when I remove the code to align Summary band,
everything is ok too.
Do you have any ideas what is going on?
Comments
FR counts the free place for PageSummary itself.
Can you clarify please ?
This code chcecks if there is
enough space for summary band.
If not, the new page is created, and
band is aligned to bottom.
Summary band to bottom ?
That would be great.
procedure ReportSummary1OnBeforePrint(Sender: TfrxComponent);
begin
if engine.freespace > reportsummary1.height then
begin
Engine.CurY := Engine.PageHeight -reportsummary1.height -pagefooter1.Height - 1;
end;
end;
isummary stretxhes use
procedure ReportSummary1OnAfterCalcHeight(Sender: TfrxComponent);
begin
Engine.CurY := Engine.PageHeight -reportsummary1.height -pagefooter1.Height - 1;
end;
Solution #1 works for me