Last Row of a Reportlist summing and printing twice?
Hello
RB 12.15, Delphi XE
I have a report with a sub-report and I need to sum a field of this
subreport.
When I have little data the sum is perfect. When I have many data that
causes the sub-report to break to a new page the sum is incorrect and
the first row of the prvious page is reprinted on the next page. Looking
further I can see that it sums the first element that is printed in the
new page twice.
I don´t know how to avoid that the last row is reprinted on the next
page and calculated twice.
Thanks
Christoph
RB 12.15, Delphi XE
I have a report with a sub-report and I need to sum a field of this
subreport.
When I have little data the sum is perfect. When I have many data that
causes the sub-report to break to a new page the sum is incorrect and
the first row of the prvious page is reprinted on the next page. Looking
further I can see that it sums the first element that is printed in the
new page twice.
I don´t know how to avoid that the last row is reprinted on the next
page and calculated twice.
Thanks
Christoph
This discussion has been closed.
Comments
Are you using a DBCalc component to calculate this sum or are you making
this calculation manually in code. If manually, which event are you
performing the calculation. Is your detail band's print height set to
Static or Dynamic?
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Yes I use a DBCalc component and a TppJITPipeline to get the records. In
the TppJITPipline I use:
function TfAbfragen.AbfrageDatenCheckBOF: Boolean;
begin
Result:= gvQueryFunction.DataController.IsBOF;
end;
function TfAbfragen.AbfrageDatenGetFieldValue(aFieldName: string): Variant;
var
id: integer;
begin
id:= gvQueryFunction.GetColumnByFieldName(aFieldName).Index;
Result:=
gvQueryFunction.DataController.GetRowValue(gvQueryFunction.DataController.GetRowInfo(gvQueryFunction.DataController.FocusedRowIndex),ID);
end;
procedure TfAbfragen.AbfrageDatenGotoFirstRecord(Sender: TObject);
begin
gvQueryFunction.DataController.GotoFirst;
end;
procedure TfAbfragen.AbfrageDatenGotoLastRecord(Sender: TObject);
begin
gvQueryFunction.DataController.GotoLast;
end;
procedure TfAbfragen.AbfrageDatenTraverseBy(aIncrement: Integer);
begin
gvQueryFunction.DataController.MoveBy(aIncrement);
end;
RangeEnd := reCount
RangeEndCoount:= qQueryFunction.RecordCount;
The Print height of the detail band's is phStatic.
Thank you and best Regards
Chritoph
Am 05.03.2012 16:09, schrieb Nico Cizik (Digital Metaphors):
Now it works fine :-). It was the detail band's print height witch was
Static. I turned it to Dynamic and it works great now.
Tanks a lot.
Best Reagards
Christoph
Am 05.03.2012 16:09, schrieb Nico Cizik (Digital Metaphors):